Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Hugman

Hugman

Members
 View Profile  See their activity
  • Content Count

    18
  • Joined

    December 27, 2018
  • Last visited

    June 15, 2020

Community Reputation

0 Neutral

About Hugman

  • Rank
    Tree Puncher

Converted

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hugman

    [1.15.2] Custom GUI Inventory/container offset by 5 slots

    Hugman posted a topic in Modder Support

    So, I want to create a new way to store my items. Essentially, new armor slots, called the "Outfit". I thought I'd need to start with the GUI. So I did this, and ran into some issues. Basically, I almost did a clone of the basic player inventory. However, I removed the crafting grid and for some reason that led all the other slots to offset by 5 when clicking (this is logic), however I don't understand whatever value was used to create this issue. Links: OutfitScreen.java OutfitContainer.java
    • April 25, 2020
    • 1 reply
  2. Hugman Hugman changed their profile photo April 25, 2020
  3. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Okay, it works now. For anyone interested, here's my class: public final class MoveFiles { public static void copyToWorld(String dir, String file, int dim) throws IOException { InputStream FROM = MoveFiles.class.getClassLoader().getResourceAsStream("assets/mubble/worlds/" + dir + "/" + file); Path TO = new File(Minecraft.getMinecraft().gameDir + "/saves/" + Minecraft.getMinecraft().getIntegratedServer().getFolderName(), "/DIM" + dim + "/" + file).toPath(); CopyOption[] options = new CopyOption[] { }; Path parentDir = TO.getParent(); if (!Files.exists(parentDir)) Files.createDirectories(parentDir); if (Files.exists(TO)) return; Files.copy(FROM, TO, options); } }
    • December 31, 2018
    • 32 replies
  4. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Okay so apparently InputStream FROM = CopyFiles.class.getClassLoader().getResourceAsStream("assets/mubble/worlds/" + dir + "/" + file); seems to work, but now the game crashes because the StandardCopyOption.COPY_ATTRIBUTES is not supported, should I just remove it?
    • December 31, 2018
    • 32 replies
  5. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    So at the end, how the FROM variable will look like? I'm sorry, I still don't really understand from which class I must do the getResourceAsStream neither what to put in it. Also, my region folder is located here:
    • December 31, 2018
    • 32 replies
  6. Hugman started following 1.12 Mod Dimension from pre-made map December 30, 2018
  7. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Following what you've said,here's my new-new method: public final class CopyFiles { public static void toWorld(String dir, String file, int dim) throws IOException { InputStream FROM = CopyFiles.class.getResourceAsStream("assets/mubble/worlds" + dir + "/" + file); //Path FROM = new File(new ResourceLocation(Reference.MODID + ":worlds/" + dir + "/" + file).getPath()).toPath(); Path TO = new File(DimensionManager.getCurrentSaveRootDirectory(), "DIM-64/" + file).toPath(); CopyOption[] options = new CopyOption[] { StandardCopyOption.COPY_ATTRIBUTES }; Files.copy(FROM, TO, options); } } The game crashes, FROM is null. I don't think I understood how to use getResourceAsStream, could you explain please?
    • December 30, 2018
    • 32 replies
  8. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Hey again! I actually progressed very well since yetersday and found a way to do it properly, but I still need to solve an issue. Firstly, here's my new method: public final class CopyFiles { public static void toWorld(String dir, String file, int dim) throws IOException { Path FROM = new File(new ResourceLocation(Reference.MODID + ":worlds/" + dir + "/" + file).getPath()).toPath(); Path TO = new File(DimensionManager.getCurrentSaveRootDirectory(), "DIM-64/" + file).toPath(); CopyOption[] options = new CopyOption[] { StandardCopyOption.COPY_ATTRIBUTES }; Files.copy(FROM, TO, options); } } But upon loading the world, the game crashes and reports: java.nio.file.NoSuchFileException: worlds\wol\region\r.0.0.mca which I interpretate as an error with the FROM variable. Anything helping would be very cool, thanks in advance. EDIT: Woops, didn't saw the thread had a second page, currently looking at what you said, this very comment is useless, do like if you didn't saw it.
    • December 30, 2018
    • 32 replies
  9. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Yes, sure, that's what I want. public final class CopyFiles { public static void toWorld(String FROM_s) throws IOException { Path FROM = Paths.get(FROM_s); Path TO = DimensionManager.getCurrentSaveRootDirectory().toPath(); CopyOption[] options = new CopyOption[] { StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES }; Files.copy(FROM, TO, options); } } I've made this class, but now I must get the path to my map in the .jar for the var Path, how can I do this?
    • December 29, 2018
    • 32 replies
  10. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Then I must copy the files to .minecraft\saves\<world>\DIM64, am I right?
    • December 28, 2018
    • 32 replies
  11. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Completely editable, changes persists, like a normal dimension, but the base map is already built.
    • December 27, 2018
    • 32 replies
  12. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    No, I want to have a dimension but it's actually a pre-built map. I want to copy the dimension world files I got in the .jar to the world directory so I can actually load the map.
    • December 27, 2018
    • 32 replies
  13. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    .minecraft\saves\<world> So I can put the dimension world directory in .minecraft\saves\<world>\DIM64 (as my dimension's ID is 64)
    • December 27, 2018
    • 32 replies
  14. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Yes, but I want this directory to be the dimension folder that is directly put into the world folder itself.
    • December 27, 2018
    • 32 replies
  15. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Oh okay, misunderstood, got it now. But still, how may I find the world file and put it as dir in Files.createTempDirectory(dir, prefix, attrs);?
    • December 27, 2018
    • 32 replies
  16. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    I've done this FileMover class: public class FileMover { public static Path createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs) throws IOException { return dir; } } But then? How do I get the path to the world file itself, at dir in FileMover.createTempDirectory(dir, prefix, attrs);?
    • December 27, 2018
    • 32 replies
  17. Hugman

    1.12 Mod Dimension from pre-made map

    Hugman replied to DougLazy's topic in Modder Support

    Okay, thanks!
    • December 27, 2018
    • 32 replies
  • All Activity
  • Home
  • Hugman
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community