Class BlueprintUtil
java.lang.Object
com.ldtteam.structurize.blueprints.v1.BlueprintUtil
- Since:
- 0.1.0 State: not completed
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic short[][][]convertSaveDataToBlocks(int[] ints, short sizeX, short sizeY, short sizeZ) Converts a 1 Dimensional int Array to a 3 Dimensional short Arraystatic BlueprintcreateBlueprint(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 worldstatic voidfixCross1343(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 BlueprintreadBlueprintFromNBT(net.minecraft.nbt.CompoundTag nbtTag) Deserializes a Blueprint form the Given CompoundNBTstatic net.minecraft.nbt.CompoundTagwriteBlueprintToNBT(Blueprint schem) Serializes a given Blueprint to an CompoundNBTstatic voidwriteToStream(OutputStream os, Blueprint schem) Attempts to write a Blueprint to an Output Stream
-
Field Details
-
DEFAULT_FIXER_IF_NOT_FOUND
public static final int DEFAULT_FIXER_IF_NOT_FOUND -
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 Blueprintpos- The Position of the BlueprintsizeX- The Size on the X-AxissizeY- The Size on the Y-AxissizeZ- The Size on the Z-Axisname- a Name for the Structure- Returns:
- the generated Blueprint
-
writeBlueprintToNBT
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
Deserializes a Blueprint form the Given CompoundNBT- Parameters:
nbtTag- The CompoundNBT containing the Blueprint Data- Returns:
- A desserialized Blueprint
-
writeToStream
Attempts to write a Blueprint to an Output Stream- Parameters:
os- The Output Stream to write toschem- 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 ArraysizeX- Sturcture size on the X-AxissizeY- Sturcture size on the Y-AxissizeZ- Sturcture size on the Z-Axis- Returns:
- An 3 Dimensional short array
-