From 5ff274f040c6bd568857730144a8e22e1402399a Mon Sep 17 00:00:00 2001 From: rycbar0 Date: Thu, 29 Sep 2022 19:58:05 +0200 Subject: [PATCH 1/4] Change requests part one --- .../launch/mixins/MixinNBTTagLongArray.java | 2 - src/launch/resources/mixins.baritone.json | 4 +- .../format/DefaultSchematicFormats.java | 2 +- .../format/defaults/LitematicaSchematic.java | 73 ++++++++----------- 4 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/launch/java/baritone/launch/mixins/MixinNBTTagLongArray.java b/src/launch/java/baritone/launch/mixins/MixinNBTTagLongArray.java index a4cd739a..2c05e544 100644 --- a/src/launch/java/baritone/launch/mixins/MixinNBTTagLongArray.java +++ b/src/launch/java/baritone/launch/mixins/MixinNBTTagLongArray.java @@ -32,6 +32,4 @@ public abstract class MixinNBTTagLongArray implements INBTTagLongArray { @Accessor("data") @Override public abstract long[] getLongArray(); - - } \ No newline at end of file diff --git a/src/launch/resources/mixins.baritone.json b/src/launch/resources/mixins.baritone.json index c4b88481..98273663 100644 --- a/src/launch/resources/mixins.baritone.json +++ b/src/launch/resources/mixins.baritone.json @@ -23,6 +23,7 @@ "MixinItemStack", "MixinItemTool", "MixinMinecraft", + "MixinNBTTagLongArray", "MixinNetHandlerPlayClient", "MixinNetworkManager", "MixinPlayerControllerMP", @@ -31,7 +32,6 @@ "MixinStateImplementation", "MixinTabCompleter", "MixinVboRenderList", - "MixinWorldClient", - "MixinNBTTagLongArray" + "MixinWorldClient" ] } \ No newline at end of file diff --git a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java index de142b39..d8049ce4 100644 --- a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java +++ b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java @@ -71,7 +71,7 @@ public enum DefaultSchematicFormats implements ISchematicFormat { /** * The Litematica schematic specification. Commonly denoted by the ".litematic" file extension. */ - Litematica("litematic") { + LITEMATICA("litematic") { @Override public IStaticSchematic parse(InputStream input) throws IOException { NBTTagCompound nbt = CompressedStreamTools.readCompressed(input); diff --git a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java index 37d132fb..4cccecee 100644 --- a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java +++ b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java @@ -37,27 +37,30 @@ import java.util.*; * */ public final class LitematicaSchematic extends StaticSchematic { - int minX=0; - int minY=0; - int minZ=0; - private static final String reg = "Regions"; - private static final String meta = "Metadata"; - private static final String schemSize = "EnclosingSize"; - private static final String blSt = "BlockStates"; - private static final String blStPl = "BlockStatePalette"; - private static final String pos = "Position"; - private static final String size = "Size"; + private final int minX; + private final int minY; + private final int minZ; public LitematicaSchematic(NBTTagCompound nbt) { - getMinimumCorner(nbt); + int x=0; + int y=0; + int z=0; + for (String subReg : getRegions(nbt)) { + x = Math.min(x, getMinimumCord(nbt, subReg,"x")); + y = Math.min(y, getMinimumCord(nbt, subReg,"y")); + z = Math.min(z, getMinimumCord(nbt, subReg,"z")); + } + this.minX = x; + this.minY = y; + this.minZ = z; - this.x = Math.abs(nbt.getCompoundTag(meta).getCompoundTag(schemSize).getInteger("x")); - this.y = Math.abs(nbt.getCompoundTag(meta).getCompoundTag(schemSize).getInteger("y")); - this.z = Math.abs(nbt.getCompoundTag(meta).getCompoundTag(schemSize).getInteger("z")); + this.x = Math.abs(nbt.getCompoundTag("Metadata").getCompoundTag("EnclosingSize").getInteger("x")); + this.y = Math.abs(nbt.getCompoundTag("Metadata").getCompoundTag("EnclosingSize").getInteger("y")); + this.z = Math.abs(nbt.getCompoundTag("Metadata").getCompoundTag("EnclosingSize").getInteger("z")); this.states = new IBlockState[this.x][this.z][this.y]; for (String subReg : getRegions(nbt)) { - NBTTagList usedBlockTypes = nbt.getCompoundTag(reg).getCompoundTag(subReg).getTagList(blStPl, 10); + NBTTagList usedBlockTypes = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getTagList("BlockStatePalette", 10); IBlockState[] blockList = getBlockList(usedBlockTypes); int bitsPerBlock = getBitsPerBlock(usedBlockTypes.tagCount()); @@ -74,28 +77,16 @@ public final class LitematicaSchematic extends StaticSchematic { * @return Array of subregion names. */ private static String[] getRegions(NBTTagCompound nbt) { - return nbt.getCompoundTag(reg).getKeySet().toArray(new String[0]); - } - - /** - * Calculates the minimum cords/origin of the schematic as litematica schematics - * can have a non-minimum origin. - */ - private void getMinimumCorner(NBTTagCompound nbt) { - for (String subReg : getRegions(nbt)) { - this.minX = Math.min(this.minX, getMinimumCord(nbt, subReg,"x")); - this.minY = Math.min(this.minY, getMinimumCord(nbt, subReg,"y")); - this.minZ = Math.min(this.minZ, getMinimumCord(nbt, subReg,"z")); - } + return nbt.getCompoundTag("Regions").getKeySet().toArray(new String[0]); } /** * @param s axis that should be read. - * @return the lower cord of the requested axis. + * @return the lower coord of the requested axis. */ private static int getMinimumCord(NBTTagCompound nbt, String subReg, String s) { - int a = nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(pos).getInteger(s); - int b = nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger(s); + int a = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Position").getInteger(s); + int b = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger(s); if (b < 0) { b++; } @@ -167,16 +158,16 @@ public final class LitematicaSchematic extends StaticSchematic { */ private static long getVolume(NBTTagCompound nbt, String subReg) { return Math.abs( - nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("x") * - nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("y") * - nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("z")); + nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("x") * + nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("y") * + nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z")); } /** * @return array of Long values. */ private static long[] getBlockStates(NBTTagCompound nbt, String subReg) { - return ((INBTTagLongArray) nbt.getCompoundTag(reg).getCompoundTag(subReg).getTag(blSt)).getLongArray(); + return ((INBTTagLongArray) nbt.getCompoundTag("Regions").getCompoundTag(subReg).getTag("BlockStates")).getLongArray(); } /** @@ -201,16 +192,16 @@ public final class LitematicaSchematic extends StaticSchematic { } /** - * @param x cord of the schematic. - * @param y cord of the schematic. - * @param z cord of the schematic. + * @param x coord of the schematic. + * @param y coord of the schematic. + * @param z coord of the schematic. * @return if the current block is inside the subregion. */ private static boolean inSubregion(NBTTagCompound nbt, String subReg, int x, int y, int z) { return - x < Math.abs(nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("x")) && - y < Math.abs(nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("y")) && - z < Math.abs(nbt.getCompoundTag(reg).getCompoundTag(subReg).getCompoundTag(size).getInteger("z")); + x < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("x")) && + y < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("y")) && + z < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z")); } /** LitematicaBitArray class from litematica */ From 7ba3de57d02e34962af3b4f610cee446b7b30196 Mon Sep 17 00:00:00 2001 From: rycbar0 Date: Thu, 29 Sep 2022 20:20:38 +0200 Subject: [PATCH 2/4] credits LitematicaBitArray --- .../schematic/format/defaults/LitematicaSchematic.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java index 4cccecee..df8c82ee 100644 --- a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java +++ b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java @@ -204,7 +204,11 @@ public final class LitematicaSchematic extends StaticSchematic { z < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z")); } - /** LitematicaBitArray class from litematica */ + /** + * @author maruohon + * Class from the Litematica mod by maruohon + * https://github.com/maruohon/litematica + */ private static class LitematicaBitArray { /** The long array that is used to store the data for this BitArray. */ From e99fcbbe36450f414d98f860c461973a7ee20b07 Mon Sep 17 00:00:00 2001 From: rycbar0 Date: Thu, 29 Sep 2022 21:47:42 +0200 Subject: [PATCH 3/4] Change requests part two --- .../format/DefaultSchematicFormats.java | 8 +- .../format/defaults/LitematicaSchematic.java | 180 +++++++++--------- 2 files changed, 89 insertions(+), 99 deletions(-) diff --git a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java index d8049ce4..699f87bc 100644 --- a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java +++ b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java @@ -77,11 +77,11 @@ public enum DefaultSchematicFormats implements ISchematicFormat { NBTTagCompound nbt = CompressedStreamTools.readCompressed(input); int version = nbt.getInteger("Version"); switch (version) { - case 4: + case 4: //1.12 return new LitematicaSchematic(nbt); - case 5: - case 6: - throw new UnsupportedOperationException("This Schematic Verion is to new."); + case 5: //1.13-1.17 + case 6: //1.18+ + throw new UnsupportedOperationException("This litematic Verion is to new."); default: throw new UnsupportedOperationException("Unsuported Version of a Litematica Schematic"); } diff --git a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java index df8c82ee..3f0e165f 100644 --- a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java +++ b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java @@ -17,24 +17,24 @@ package baritone.utils.schematic.format.defaults; -import baritone.utils.schematic.StaticSchematic; import baritone.utils.accessor.INBTTagLongArray; -import net.minecraft.block.*; +import baritone.utils.schematic.StaticSchematic; +import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; -import net.minecraft.nbt.*; -import net.minecraft.util.ResourceLocation; import net.minecraft.block.state.IBlockState; - +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ResourceLocation; import org.apache.commons.lang3.Validate; + import javax.annotation.Nullable; -import java.util.*; +import java.util.Optional; /** * @author Emerson * @since 12/27/2020 * @author rycbar * @since 22.09.2022 - * */ public final class LitematicaSchematic extends StaticSchematic { private final int minX; @@ -42,13 +42,13 @@ public final class LitematicaSchematic extends StaticSchematic { private final int minZ; public LitematicaSchematic(NBTTagCompound nbt) { - int x=0; - int y=0; - int z=0; + int x = 0; + int y = 0; + int z = 0; for (String subReg : getRegions(nbt)) { - x = Math.min(x, getMinimumCord(nbt, subReg,"x")); - y = Math.min(y, getMinimumCord(nbt, subReg,"y")); - z = Math.min(z, getMinimumCord(nbt, subReg,"z")); + x = Math.min(x, getMinimumCoord(nbt, subReg, "x")); + y = Math.min(y, getMinimumCoord(nbt, subReg, "y")); + z = Math.min(z, getMinimumCoord(nbt, subReg, "z")); } this.minX = x; this.minY = y; @@ -81,16 +81,17 @@ public final class LitematicaSchematic extends StaticSchematic { } /** + * Gets both ends from schematic box for a given axis and returns the lower one. * @param s axis that should be read. * @return the lower coord of the requested axis. */ - private static int getMinimumCord(NBTTagCompound nbt, String subReg, String s) { + private static int getMinimumCoord(NBTTagCompound nbt, String subReg, String s) { int a = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Position").getInteger(s); int b = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger(s); if (b < 0) { b++; } - return Math.min(a,a+b); + return Math.min(a, a + b); } @@ -101,7 +102,7 @@ public final class LitematicaSchematic extends StaticSchematic { private static IBlockState[] getBlockList(NBTTagList blockStatePalette) { IBlockState[] blockList = new IBlockState[blockStatePalette.tagCount()]; - for (int i = 0; i< blockStatePalette.tagCount(); i++) { + for (int i = 0; i < blockStatePalette.tagCount(); i++) { Block block = Block.REGISTRY.getObject(new ResourceLocation((((NBTTagCompound) blockStatePalette.get(i)).getString("Name")))); NBTTagCompound properties = ((NBTTagCompound) blockStatePalette.get(i)).getCompoundTag("Properties"); @@ -111,7 +112,7 @@ public final class LitematicaSchematic extends StaticSchematic { } /** - * @param block block. + * @param block block. * @param properties List of Properties the block has. * @return A blockState. */ @@ -129,12 +130,7 @@ public final class LitematicaSchematic extends StaticSchematic { } /** - * i haven't written this and i wont try to decode it. - * @param state . - * @param property . - * @param value . - * @return . - * @param . + * @author Emerson */ private static > IBlockState setPropertyValue(IBlockState state, IProperty property, String value) { Optional parsed = property.parseValue(value).toJavaUtil(); @@ -150,10 +146,12 @@ public final class LitematicaSchematic extends StaticSchematic { * @return amount of bits used to encode a block. */ private static int getBitsPerBlock(int amountOfBlockTypes) { - return (int) Math.floor((Math.log(amountOfBlockTypes)) / Math.log(2))+1; + return (int) Math.floor((Math.log(amountOfBlockTypes)) / Math.log(2)) + 1; } /** + * Calculates the volume of the subregion. As size can be a negative value we take the absolute value of the + * multiplication as the volume still holds a positive amount of blocks. * @return the volume of the subregion. */ private static long getVolume(NBTTagCompound nbt, String subReg) { @@ -171,19 +169,36 @@ public final class LitematicaSchematic extends StaticSchematic { } /** - * @param blockList list with the different block types used in the schematic - * @param bitArray bit array that holds the placement pattern + * Subregion don't have to be the same size as the enclosing size of the schematic. If they are smaller we check here if the current block is part of the subregion. + * @param x coord of the block relative to the minimum corner. + * @param y coord of the block relative to the minimum corner. + * @param z coord of the block relative to the minimum corner. + * @return if the current block is part of the subregion. */ + private static boolean inSubregion(NBTTagCompound nbt, String subReg, int x, int y, int z) { + return + x < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("x")) && + y < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("y")) && + z < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z")); + } + + /** + * @param blockList list with the different block types used in the schematic + * @param bitArray bit array that holds the placement pattern + */ + //x,y,z are the releative positons to the minimum corner of the enclosing box + //minX,minY,minZ are correction terms if the schematic origin isn't the minimum corner + //posX,posY,posZ are the subregions offset relative to the minimum corner private void writeSubregionIntoSchematic(NBTTagCompound nbt, String subReg, IBlockState[] blockList, LitematicaBitArray bitArray) { - int posX = getMinimumCord(nbt, subReg,"x"); - int posY = getMinimumCord(nbt, subReg,"y"); - int posZ = getMinimumCord(nbt, subReg,"z"); + int posX = getMinimumCoord(nbt, subReg, "x"); + int posY = getMinimumCoord(nbt, subReg, "y"); + int posZ = getMinimumCoord(nbt, subReg, "z"); int index = 0; for (int y = 0; y < this.y; y++) { for (int z = 0; z < this.z; z++) { for (int x = 0; x < this.x; x++) { if (inSubregion(nbt, subReg, x, y, z)) { - this.states[x-(minX- posX)][z-(minZ- posZ)][y-(minY- posY)] = blockList[bitArray.getAt(index)]; + this.states[x - (minX - posX)][z - (minZ - posZ)][y - (minY - posY)] = blockList[bitArray.getAt(index)]; index++; } } @@ -191,95 +206,51 @@ public final class LitematicaSchematic extends StaticSchematic { } } - /** - * @param x coord of the schematic. - * @param y coord of the schematic. - * @param z coord of the schematic. - * @return if the current block is inside the subregion. - */ - private static boolean inSubregion(NBTTagCompound nbt, String subReg, int x, int y, int z) { - return - x < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("x")) && - y < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("y")) && - z < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z")); - } - /** * @author maruohon * Class from the Litematica mod by maruohon - * https://github.com/maruohon/litematica + * ... */ - private static class LitematicaBitArray - { - /** The long array that is used to store the data for this BitArray. */ + private static class LitematicaBitArray { + /** + * The long array that is used to store the data for this BitArray. + */ private final long[] longArray; - /** Number of bits a single entry takes up */ + /** + * Number of bits a single entry takes up + */ private final int bitsPerEntry; /** * The maximum value for a single entry. This also works as a bitmask for a single entry. * For instance, if bitsPerEntry were 5, this value would be 31 (ie, {@code 0b00011111}). */ private final long maxEntryValue; - /** Number of entries in this array (not the length of the long array that internally backs this array) */ + /** + * Number of entries in this array (not the length of the long array that internally backs this array) + */ private final long arraySize; - public LitematicaBitArray(int bitsPerEntryIn, long arraySizeIn, @Nullable long[] longArrayIn) - { - Validate.inclusiveBetween(1L, 32L, (long) bitsPerEntryIn); + public LitematicaBitArray(int bitsPerEntryIn, long arraySizeIn, @Nullable long[] longArrayIn) { + Validate.inclusiveBetween(1L, 32L, bitsPerEntryIn); this.arraySize = arraySizeIn; this.bitsPerEntry = bitsPerEntryIn; this.maxEntryValue = (1L << bitsPerEntryIn) - 1L; - if (longArrayIn != null) - { + if (longArrayIn != null) { this.longArray = longArrayIn; - } - else - { - this.longArray = new long[(int) (roundUp((long) arraySizeIn * (long) bitsPerEntryIn, 64L) / 64L)]; + } else { + this.longArray = new long[(int) (roundUp(arraySizeIn * (long) bitsPerEntryIn, 64L) / 64L)]; } } - public int getAt(long index) - { - Validate.inclusiveBetween(0L, this.arraySize - 1L, (long) index); - long startOffset = index * (long) this.bitsPerEntry; - int startArrIndex = (int) (startOffset >> 6); // startOffset / 64 - int endArrIndex = (int) (((index + 1L) * (long) this.bitsPerEntry - 1L) >> 6); - int startBitOffset = (int) (startOffset & 0x3F); // startOffset % 64 - - if (startArrIndex == endArrIndex) - { - return (int) (this.longArray[startArrIndex] >>> startBitOffset & this.maxEntryValue); - } - else - { - int endOffset = 64 - startBitOffset; - return (int) ((this.longArray[startArrIndex] >>> startBitOffset | this.longArray[endArrIndex] << endOffset) & this.maxEntryValue); - } - } - - - public long size() - { - return this.arraySize; - } - - public static long roundUp(long number, long interval) - { + public static long roundUp(long number, long interval) { int sign = 1; - if (interval == 0) - { + if (interval == 0) { return 0; - } - else if (number == 0) - { + } else if (number == 0) { return interval; - } - else - { - if (number < 0) - { + } else { + if (number < 0) { sign = -1; } @@ -287,5 +258,24 @@ public final class LitematicaSchematic extends StaticSchematic { return i == 0 ? number : number + (interval * sign) - i; } } + + public int getAt(long index) { + Validate.inclusiveBetween(0L, this.arraySize - 1L, index); + long startOffset = index * (long) this.bitsPerEntry; + int startArrIndex = (int) (startOffset >> 6); // startOffset / 64 + int endArrIndex = (int) (((index + 1L) * (long) this.bitsPerEntry - 1L) >> 6); + int startBitOffset = (int) (startOffset & 0x3F); // startOffset % 64 + + if (startArrIndex == endArrIndex) { + return (int) (this.longArray[startArrIndex] >>> startBitOffset & this.maxEntryValue); + } else { + int endOffset = 64 - startBitOffset; + return (int) ((this.longArray[startArrIndex] >>> startBitOffset | this.longArray[endArrIndex] << endOffset) & this.maxEntryValue); + } + } + + public long size() { + return this.arraySize; + } } } \ No newline at end of file From 484b3326c77c92d749cc24d919888d726ab05dc4 Mon Sep 17 00:00:00 2001 From: rycbar0 Date: Thu, 29 Sep 2022 21:52:15 +0200 Subject: [PATCH 4/4] auto-format all files I touched --- .../utils/schematic/format/DefaultSchematicFormats.java | 2 +- .../utils/schematic/format/defaults/LitematicaSchematic.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java index 699f87bc..faabe57b 100644 --- a/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java +++ b/src/main/java/baritone/utils/schematic/format/DefaultSchematicFormats.java @@ -19,9 +19,9 @@ package baritone.utils.schematic.format; import baritone.api.schematic.IStaticSchematic; import baritone.api.schematic.format.ISchematicFormat; +import baritone.utils.schematic.format.defaults.LitematicaSchematic; import baritone.utils.schematic.format.defaults.MCEditSchematic; import baritone.utils.schematic.format.defaults.SpongeSchematic; -import baritone.utils.schematic.format.defaults.LitematicaSchematic; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import org.apache.commons.io.FilenameUtils; diff --git a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java index 3f0e165f..12b3264f 100644 --- a/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java +++ b/src/main/java/baritone/utils/schematic/format/defaults/LitematicaSchematic.java @@ -82,6 +82,7 @@ public final class LitematicaSchematic extends StaticSchematic { /** * Gets both ends from schematic box for a given axis and returns the lower one. + * * @param s axis that should be read. * @return the lower coord of the requested axis. */ @@ -152,6 +153,7 @@ public final class LitematicaSchematic extends StaticSchematic { /** * Calculates the volume of the subregion. As size can be a negative value we take the absolute value of the * multiplication as the volume still holds a positive amount of blocks. + * * @return the volume of the subregion. */ private static long getVolume(NBTTagCompound nbt, String subReg) { @@ -170,6 +172,7 @@ public final class LitematicaSchematic extends StaticSchematic { /** * Subregion don't have to be the same size as the enclosing size of the schematic. If they are smaller we check here if the current block is part of the subregion. + * * @param x coord of the block relative to the minimum corner. * @param y coord of the block relative to the minimum corner. * @param z coord of the block relative to the minimum corner.