Class BlueprintUtil

java.lang.Object
com.ldtteam.structurize.blueprints.v1.BlueprintUtil

public class BlueprintUtil extends Object
Since:
0.1.0 State: not completed
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static short[][][]
    convertSaveDataToBlocks(int[] ints, short sizeX, short sizeY, short sizeZ)
    Converts a 1 Dimensional int Array to a 3 Dimensional short Array
    static Blueprint
    createBlueprint(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, boolean saveEntities, short sizeX, short sizeY, short sizeZ, String name, Optional<net.minecraft.core.BlockPos> anchorPos)
    Generates a Blueprint objects from the world
    static void
    fixCross1343(List<net.minecraft.world.level.block.state.BlockState> palette, short[][][] blocks, net.minecraft.nbt.CompoundTag[] tileEntities, net.minecraft.nbt.CompoundTag[] entities)
     
    static net.minecraft.nbt.CompoundTag[]
    fixEntities(int oldDataVersion, net.minecraft.nbt.ListTag entitiesTag)
     
    static List<net.minecraft.world.level.block.state.BlockState>
    fixPalette(int oldDataVersion, net.minecraft.nbt.ListTag paletteTag)
     
    static net.minecraft.nbt.CompoundTag[]
    fixTileEntities(int oldDataVersion, net.minecraft.nbt.ListTag tileEntitiesTag)
     
    static Blueprint
    readBlueprintFromNBT(net.minecraft.nbt.CompoundTag nbtTag)
    Deserializes a Blueprint form the Given CompoundNBT
    static net.minecraft.nbt.CompoundTag
    Serializes a given Blueprint to an CompoundNBT
    static void
    Attempts to write a Blueprint to an Output Stream

    Methods inherited from class java.lang.Object

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

    • DEFAULT_FIXER_IF_NOT_FOUND

      public static final int DEFAULT_FIXER_IF_NOT_FOUND
    • NBT_OPTIONAL_DATA_TAG

      public static final String NBT_OPTIONAL_DATA_TAG
      See Also:
  • Constructor Details

    • BlueprintUtil

      public BlueprintUtil()
  • Method Details

    • createBlueprint

      public static Blueprint createBlueprint(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, boolean saveEntities, short sizeX, short sizeY, short sizeZ, String name, Optional<net.minecraft.core.BlockPos> anchorPos)
      Generates a Blueprint objects from the world
      Parameters:
      world - The World that is used for the Blueprint
      pos - The Position of the Blueprint
      sizeX - The Size on the X-Axis
      sizeY - The Size on the Y-Axis
      sizeZ - The Size on the Z-Axis
      name - a Name for the Structure
      Returns:
      the generated Blueprint
    • writeBlueprintToNBT

      public static net.minecraft.nbt.CompoundTag writeBlueprintToNBT(Blueprint schem)
      Serializes a given Blueprint to an CompoundNBT
      Parameters:
      schem - The Blueprint to serialize
      Returns:
      An CompoundNBT containing the Blueprint Data
    • fixPalette

      public static List<net.minecraft.world.level.block.state.BlockState> fixPalette(int oldDataVersion, net.minecraft.nbt.ListTag paletteTag)
    • fixTileEntities

      public static net.minecraft.nbt.CompoundTag[] fixTileEntities(int oldDataVersion, net.minecraft.nbt.ListTag tileEntitiesTag)
    • fixEntities

      public static net.minecraft.nbt.CompoundTag[] fixEntities(int oldDataVersion, net.minecraft.nbt.ListTag entitiesTag)
    • fixCross1343

      public static void fixCross1343(List<net.minecraft.world.level.block.state.BlockState> palette, short[][][] blocks, net.minecraft.nbt.CompoundTag[] tileEntities, net.minecraft.nbt.CompoundTag[] entities)
    • readBlueprintFromNBT

      public static Blueprint readBlueprintFromNBT(net.minecraft.nbt.CompoundTag nbtTag)
      Deserializes a Blueprint form the Given CompoundNBT
      Parameters:
      nbtTag - The CompoundNBT containing the Blueprint Data
      Returns:
      A desserialized Blueprint
    • writeToStream

      public static void writeToStream(OutputStream os, Blueprint schem)
      Attempts to write a Blueprint to an Output Stream
      Parameters:
      os - The Output Stream to write to
      schem - The Blueprint to write
    • convertSaveDataToBlocks

      public static short[][][] convertSaveDataToBlocks(int[] ints, short sizeX, short sizeY, short sizeZ)
      Converts a 1 Dimensional int Array to a 3 Dimensional short Array
      Parameters:
      ints - 1 Dimensioanl int Array
      sizeX - Sturcture size on the X-Axis
      sizeY - Sturcture size on the Y-Axis
      sizeZ - Sturcture size on the Z-Axis
      Returns:
      An 3 Dimensional short array