Class SaveChunkShapeInfo
That is a way to generate a really large structure. Since that the nbt is saved during world gen, no block entity should be present.
This class is used to create JSON files.
It is used by this mod to divide a structure into chunks.
If the structure is larger than a chunk, it will save the structure into chunks that will be saved into JSON files.
The JSON files will then be saved into the following path : [save_name]/generated/easierworldcreator/[chunk.x-chunk.z]/custom_feature_[Random long].
It will then be read by the following class LoadChunkShapeInfo
Since that to generate large structures, it requires to write and read the json file, be careful to don't have a too big structure. It may use a lot of performance during the write of every files
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathcreateFolders(Path path) divideBlocks(Set<BlockList> blockLists) divides the a list of blockList into a list of list of blockList that represents every Chunk of the BlockListstatic voidsaveChunkWorldGen(Set<BlockList> blockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name) This is the main method on saving the structure into JSON filesstatic voidsaveDuringWorldGen(Set<BlockList> blockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name) This is the main method on saving the structure into JSON filessortBlockPos(Set<BlockList> blockLists) this method is used to sort the BlocKPos of a BlockList
-
Constructor Details
-
SaveChunkShapeInfo
public SaveChunkShapeInfo()
-
-
Method Details
-
saveDuringWorldGen
public static void saveDuringWorldGen(Set<BlockList> blockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name) throws IOException This is the main method on saving the structure into JSON filesI multithreaded this class for optimal performance. Since that the structure is divided into chunks, we can multithread the generation of files
- Parameters:
blockLists- the list to divide into chunks and then saving it into JSON filesworldAccess- the world the structure will spawn in- Throws:
IOException- avoid errors
-
saveChunkWorldGen
public static void saveChunkWorldGen(Set<BlockList> blockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name) throws IOException This is the main method on saving the structure into JSON filesI multithreaded this class for optimal performance. Since that the structure is divided into chunks, we can multithread the generation of files
- Parameters:
blockLists- the list to divide into chunks and then saving it into JSON filesworldAccess- the world the structure will spawn in- Throws:
IOException- avoid errors
-
sortBlockPos
this method is used to sort the BlocKPos of a BlockList- Parameters:
blockLists- the list to sort- Returns:
- the sorted list
-
divideBlocks
divides the a list of blockList into a list of list of blockList that represents every Chunk of the BlockList- Parameters:
blockLists- the list to divide into a list of chunks- Returns:
- the blockLists divided into chunks
-
createFolders
- Throws:
IOException
-