Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Hugman

Members
  • Content Count

    18
  • Joined

  • Last visited

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. 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
  2. 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))
  3. 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?
  4. 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:
  5. 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 };
  6. 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_ATTRIBUTE
  7. 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?
  8. Then I must copy the files to .minecraft\saves\<world>\DIM64, am I right?
  9. Completely editable, changes persists, like a normal dimension, but the base map is already built.
  10. 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.
  11. .minecraft\saves\<world> So I can put the dimension world directory in .minecraft\saves\<world>\DIM64 (as my dimension's ID is 64)
  12. Yes, but I want this directory to be the dimension folder that is directly put into the world folder itself.
  13. 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);?
  14. 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);?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.