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) this method allows the creation of the generated and related foldersstatic List<Set<DefaultBlockList>> divideBlocks(Set<DefaultBlockList> defaultBlockLists) divides a list of blockList into a list of blockList that represents every Chunk of the BlockListstatic voidsaveChunkWorldGen(Set<DefaultBlockList> defaultBlockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name, net.minecraft.util.math.BlockPos offset) This is the main method on saving the structure into JSON filesstatic voidsaveDuringWorldGen(Set<DefaultBlockList> defaultBlockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name, net.minecraft.util.math.BlockPos offset) This is the main method on saving the structure into JSON filesstatic Set<DefaultBlockList> sortBlockPos(Set<DefaultBlockList> defaultBlockLists) this method is used to sort the BlocKPos of a BlockList
-
Constructor Details
-
SaveChunkShapeInfo
public SaveChunkShapeInfo()
-
-
Method Details
-
saveDuringWorldGen
public static void saveDuringWorldGen(Set<DefaultBlockList> defaultBlockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name, net.minecraft.util.math.BlockPos offset) 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 multithreading the generation of files
- Parameters:
defaultBlockLists- 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<DefaultBlockList> defaultBlockLists, net.minecraft.world.StructureWorldAccess worldAccess, String name, net.minecraft.util.math.BlockPos offset) 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 multithreading the generation of files
- Parameters:
defaultBlockLists- the list to divide into chunks and then saving it into JSON filesworldAccess- the world the structure will spawn in- Throws:
IOException
-
sortBlockPos
this method is used to sort the BlocKPos of a BlockList- Parameters:
defaultBlockLists- the list to sort- Returns:
- the sorted list
-
divideBlocks
divides a list of blockList into a list of blockList that represents every Chunk of the BlockList- Parameters:
defaultBlockLists- the list to divide into a list of chunks- Returns:
- the blockLists divided into chunks
-
createFolders
this method allows the creation of the generated and related folders- Parameters:
path- the base path- Returns:
- the generated Path
- Throws:
IOException
-