Package fr.rodofire.ewc.structure
Class SaveNbt
java.lang.Object
fr.rodofire.ewc.structure.SaveNbt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.PalettecreatePalettedBlockInfoList(List<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> combinedList) avoid errors when using the mixinstatic List<net.minecraft.resources.ResourceLocation> loadNBTFiles(net.minecraft.world.level.chunk.ChunkAccess chunk) static List<net.minecraft.resources.ResourceLocation> loadNBTFiles(net.minecraft.world.level.ChunkPos chunk) gives you a list of "path" of nbt files related to a chunkPosstatic voidremoveNbtFiles(List<net.minecraft.resources.ResourceLocation> nbtList) when you want, you can remove the filestatic voidsaveNbtDuringWorldGen(net.minecraft.world.level.WorldGenLevel world, List<BlockList> defaultBlockLists, String featureName) This method converts the List of BlockList to a nbt file.
-
Constructor Details
-
SaveNbt
public SaveNbt()
-
-
Method Details
-
saveNbtDuringWorldGen
public static void saveNbtDuringWorldGen(net.minecraft.world.level.WorldGenLevel world, List<BlockList> defaultBlockLists, String featureName) This method converts the List of BlockList to a nbt file.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.
The methods receive a list of blockList. The list represents all the blocks of the generated structure. For every BlockPos and BlockStates, the method verify the chunk it belongs to and add it to the Map chunkBlockInfoMap. This divides the structure into chunks that will be saved just after converting the first list into a
StructureTemplate.PaletteThe Structure will be located in the following path : [save_name]/generated/easierworldcreator/[chunk.x-chunk.z]/custom_feature_[Random long]- Parameters:
defaultBlockLists- a list of BlockList to save it into the nbt file
-
removeNbtFiles
when you want, you can remove the file- Parameters:
nbtList- the list of the ResourceLocation related to every structure that has to be removed
-
loadNBTFiles
public static List<net.minecraft.resources.ResourceLocation> loadNBTFiles(net.minecraft.world.level.chunk.ChunkAccess chunk) -
loadNBTFiles
public static List<net.minecraft.resources.ResourceLocation> loadNBTFiles(net.minecraft.world.level.ChunkPos chunk) gives you a list of "path" of nbt files related to a chunkPos- Parameters:
chunk- the chunk of the nbt- Returns:
- the list of "path"
-
createPalettedBlockInfoList
public static net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.Palette createPalettedBlockInfoList(List<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> combinedList) avoid errors when using the mixin- Parameters:
combinedList- the list that will be converted toStructureTemplate.Palette- Returns:
- the
StructureTemplate.Paletterelated to the list
-