Jump to content

Abdymazhit

Members
  • Posts

    4
  • Joined

  • Last visited

Abdymazhit's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello! I need to save the building and the coordinates of the required blocks. For example, this is how the building looks like. And the block coordinate that I need to save looks like this. I use this code to get building blocks. The first and second blocks are redstone blocks that are located at the edges of the building. int maxY = firstBlockXYZ[1]; int firstBlockX = firstBlockXYZ[0]; int firstBlockZ = firstBlockXYZ[2]; int secondBlockX = secondBlockXYZ[0]; int secondBlockZ = secondBlockXYZ[2]; List<String> blocks = new ArrayList<>(); for(int x=firstBlockX; x>=secondBlockX; x--) { for(int z=firstBlockZ; z>=secondBlockZ; z--) { BlockPos blockPos = new BlockPos(x, maxY, z); Block block = world.getBlockState(blockPos).getBlock(); blocks.add(String.valueOf(block)); } } Further, to get the coordinates of the necessary blocks, I manually take the coordinates of the necessary blocks and subtract these coordinates from the first redstone block. Finally, I save the list of blocks and the required coordinates to a json file. { "name": "building", "blocks": [ "Block{minecraft:redstone_block}", "Block{minecraft:stone}", ... ], "coordinates": [ "-11 -7 -6", "XXX", "XXX" ] } This works great for one degree. If need to rotate the building, it won't work. I somehow need to change the block indices in the json file and, accordingly, change the coordinates of the necessary blocks. Maybe I should change the format for saving blocks and necessary blocks from a json file to a schematic file? But, I have never used the schematic and do not understand it.
  2. Hello everyone! I solved the problem by creating a new mod folder in the folder that stores all the config files. And now I use resources from there.
  3. I tried this method as well before posting this thread. But, the error was the same. (java.io.FileNotFoundException: skyblock:rooms/storage.json) new ResourceLocation("skyblock", "rooms/storage.json")
  4. Hello! I am getting error 'java.io.FileNotFoundException: skyblock:rooms/storage.json' even though the specified file is present in my resource directory. Below I have provided my code and a screenshot showing that the required file exists. public static void getStorage() { try(BufferedReader reader = new BufferedReader(new InputStreamReader(Minecraft.getInstance().getResourceManager().getResource( new ResourceLocation("skyblock:rooms/storage.json")).getInputStream(), StandardCharsets.UTF_8))) { JsonObject json = Skyblock.gson.fromJson(reader, JsonObject.class); } catch(Exception ignored) { } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.