auto formatting
This commit is contained in:
parent
fc65f22feb
commit
3a5608566e
@ -26,9 +26,9 @@ import baritone.api.process.IBuilderProcess;
|
||||
import baritone.api.process.PathingCommand;
|
||||
import baritone.api.process.PathingCommandType;
|
||||
import baritone.api.schematic.FillSchematic;
|
||||
import baritone.api.schematic.SubstituteSchematic;
|
||||
import baritone.api.schematic.ISchematic;
|
||||
import baritone.api.schematic.IStaticSchematic;
|
||||
import baritone.api.schematic.SubstituteSchematic;
|
||||
import baritone.api.schematic.format.ISchematicFormat;
|
||||
import baritone.api.utils.BetterBlockPos;
|
||||
import baritone.api.utils.RayTraceUtils;
|
||||
@ -42,8 +42,8 @@ import baritone.utils.BaritoneProcessHelper;
|
||||
import baritone.utils.BlockStateInterface;
|
||||
import baritone.utils.PathingCommandContext;
|
||||
import baritone.utils.schematic.MapArtSchematic;
|
||||
import baritone.utils.schematic.SelectionSchematic;
|
||||
import baritone.utils.schematic.SchematicSystem;
|
||||
import baritone.utils.schematic.SelectionSchematic;
|
||||
import baritone.utils.schematic.format.defaults.LitematicaSchematic;
|
||||
import baritone.utils.schematic.litematica.LitematicaHelper;
|
||||
import baritone.utils.schematic.schematica.SchematicaHelper;
|
||||
@ -183,6 +183,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
|
||||
/**
|
||||
* Builds the with index 'i' given schematic placement.
|
||||
*
|
||||
* @param i index reference to the schematic placement list.
|
||||
*/
|
||||
@Override
|
||||
|
@ -61,36 +61,6 @@ public final class LitematicaSchematic extends StaticSchematic {
|
||||
fillInSchematic();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s axis.
|
||||
* @return the lowest coordinate of that axis of the schematic.
|
||||
*/
|
||||
private int getMinOfSchematic(String s) {
|
||||
int n = Integer.MAX_VALUE;
|
||||
for (String subReg : getRegions(nbt)) {
|
||||
n = Math.min(n, getMinOfSubregion(nbt, subReg, s));
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* reads the file data.
|
||||
*/
|
||||
private void fillInSchematic() {
|
||||
for (String subReg : getRegions(nbt)) {
|
||||
NBTTagList usedBlockTypes = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getTagList("BlockStatePalette", 10);
|
||||
IBlockState[] blockList = getBlockList(usedBlockTypes);
|
||||
|
||||
int bitsPerBlock = getBitsPerBlock(usedBlockTypes.tagCount());
|
||||
long regionVolume = getVolume(nbt, subReg);
|
||||
long[] blockStateArray = getBlockStates(nbt, subReg);
|
||||
|
||||
LitematicaBitArray bitArray = new LitematicaBitArray(bitsPerBlock, regionVolume, blockStateArray);
|
||||
|
||||
writeSubregionIntoSchematic(nbt, subReg, blockList, bitArray);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Array of subregion names.
|
||||
*/
|
||||
@ -203,6 +173,36 @@ public final class LitematicaSchematic extends StaticSchematic {
|
||||
z < Math.abs(nbt.getCompoundTag("Regions").getCompoundTag(subReg).getCompoundTag("Size").getInteger("z"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s axis.
|
||||
* @return the lowest coordinate of that axis of the schematic.
|
||||
*/
|
||||
private int getMinOfSchematic(String s) {
|
||||
int n = Integer.MAX_VALUE;
|
||||
for (String subReg : getRegions(nbt)) {
|
||||
n = Math.min(n, getMinOfSubregion(nbt, subReg, s));
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* reads the file data.
|
||||
*/
|
||||
private void fillInSchematic() {
|
||||
for (String subReg : getRegions(nbt)) {
|
||||
NBTTagList usedBlockTypes = nbt.getCompoundTag("Regions").getCompoundTag(subReg).getTagList("BlockStatePalette", 10);
|
||||
IBlockState[] blockList = getBlockList(usedBlockTypes);
|
||||
|
||||
int bitsPerBlock = getBitsPerBlock(usedBlockTypes.tagCount());
|
||||
long regionVolume = getVolume(nbt, subReg);
|
||||
long[] blockStateArray = getBlockStates(nbt, subReg);
|
||||
|
||||
LitematicaBitArray bitArray = new LitematicaBitArray(bitsPerBlock, regionVolume, blockStateArray);
|
||||
|
||||
writeSubregionIntoSchematic(nbt, subReg, blockList, bitArray);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the file data in to the IBlockstate array.
|
||||
*
|
||||
|
@ -67,11 +67,7 @@ public final class LitematicaHelper {
|
||||
* @return the world coordinates of the schematic origin. This can but does not have to be the minimum corner.
|
||||
*/
|
||||
public static Vec3i getOrigin(int i) {
|
||||
int x,y,z;
|
||||
x=DataManager.getSchematicPlacementManager().getAllSchematicsPlacements().get(i).getOrigin().getX();
|
||||
y=DataManager.getSchematicPlacementManager().getAllSchematicsPlacements().get(i).getOrigin().getY();
|
||||
z=DataManager.getSchematicPlacementManager().getAllSchematicsPlacements().get(i).getOrigin().getZ();
|
||||
return new Vec3i(x,y,z);
|
||||
return DataManager.getSchematicPlacementManager().getAllSchematicsPlacements().get(i).getOrigin();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,9 +22,11 @@ import fi.dy.masa.litematica.schematic.placement.SchematicPlacementManager;
|
||||
public class DataManager {
|
||||
public static final DataManager INSTANCE = new DataManager();
|
||||
private final SchematicPlacementManager schematicPlacementManager = new SchematicPlacementManager();
|
||||
|
||||
private static DataManager getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public static SchematicPlacementManager getSchematicPlacementManager() {
|
||||
return getInstance().schematicPlacementManager;
|
||||
}
|
||||
|
@ -23,9 +23,11 @@ import net.minecraft.util.Rotation;
|
||||
public class SchematicPlacement extends SchematicPlacementUnloaded {
|
||||
private Rotation rotation;
|
||||
private Mirror mirror;
|
||||
|
||||
public Rotation getRotation() {
|
||||
return this.rotation;
|
||||
}
|
||||
|
||||
public Mirror getMirror() {
|
||||
return this.mirror;
|
||||
}
|
||||
|
@ -24,15 +24,19 @@ import java.io.File;
|
||||
|
||||
public class SchematicPlacementUnloaded {
|
||||
protected String name = "?";
|
||||
@Nullable protected File schematicFile;
|
||||
@Nullable
|
||||
protected File schematicFile;
|
||||
protected BlockPos origin = BlockPos.ORIGIN;
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getSchematicFile() {
|
||||
return this.schematicFile;
|
||||
}
|
||||
|
||||
public BlockPos getOrigin() {
|
||||
return this.origin;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user