java.lang.Object
net.rodofire.easierworldcreator.nbtutil.SaveNbt

public class SaveNbt extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.structure.StructureTemplate.PalettedBlockInfoList
    createPalettedBlockInfoList(List<net.minecraft.structure.StructureTemplate.StructureBlockInfo> combinedList)
    avoid errors when using the mixin
    static void
    generateNbtFiles(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.util.Identifier> nbtlist, net.minecraft.util.math.ChunkPos chunk)
     
    static void
    generateNbtFiles(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.util.Identifier> nbtlist, net.minecraft.world.chunk.Chunk chunk)
     
    static List<net.minecraft.util.Identifier>
    loadNBTFiles(net.minecraft.util.math.ChunkPos chunk)
     
    static List<net.minecraft.util.Identifier>
    loadNBTFiles(net.minecraft.world.chunk.Chunk chunk)
     
    static void
    removeNbtFiles(List<net.minecraft.util.Identifier> nbtlist)
    when you want, you can remove the file
    static void
    saveNbtDuringWorldGen(net.minecraft.world.StructureWorldAccess world, List<BlockList> blockLists, String featureName)
    This method converts the List of BlockList to a nbt file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SaveNbt

      public SaveNbt()
  • Method Details

    • saveNbtDuringWorldGen

      public static void saveNbtDuringWorldGen(net.minecraft.world.StructureWorldAccess world, List<BlockList> blockLists, 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.PalettedBlockInfoList The Structure will be located in the following path : [save_name]/generated/easierworldcreator/[chunk.x-chunk.z]/custom_feature_[Random long]

      Parameters:
      blockLists - a list of BlockList to save it into the nbt file
    • generateNbtFiles

      public static void generateNbtFiles(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.util.Identifier> nbtlist, net.minecraft.world.chunk.Chunk chunk)
    • generateNbtFiles

      public static void generateNbtFiles(net.minecraft.world.StructureWorldAccess world, List<net.minecraft.util.Identifier> nbtlist, net.minecraft.util.math.ChunkPos chunk)
    • removeNbtFiles

      public static void removeNbtFiles(List<net.minecraft.util.Identifier> nbtlist)
      when you want, you can remove the file
      Parameters:
      nbtlist -
    • loadNBTFiles

      public static List<net.minecraft.util.Identifier> loadNBTFiles(net.minecraft.world.chunk.Chunk chunk)
    • loadNBTFiles

      public static List<net.minecraft.util.Identifier> loadNBTFiles(net.minecraft.util.math.ChunkPos chunk)
    • createPalettedBlockInfoList

      public static net.minecraft.structure.StructureTemplate.PalettedBlockInfoList createPalettedBlockInfoList(List<net.minecraft.structure.StructureTemplate.StructureBlockInfo> combinedList)
      avoid errors when using the mixin
      Parameters:
      combinedList - the list that will be converted to StructureTemplate.PalettedBlockInfoList
      Returns:
      the StructureTemplate.PalettedBlockInfoList related to the list