From de1256cc80d5fd4ef61110f46886bf641969eee1 Mon Sep 17 00:00:00 2001 From: rycbar0 Date: Sat, 1 Oct 2022 05:27:02 +0200 Subject: [PATCH] remove spaghetti --- .../java/baritone/process/BuilderProcess.java | 69 ++----------------- .../format/defaults/LitematicaSchematic.java | 7 +- .../litematica/LitematicaHelper.java | 60 +++++++++------- 3 files changed, 46 insertions(+), 90 deletions(-) diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index e18f7aea..da56bdf9 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -58,13 +58,13 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Mirror; import net.minecraft.util.Tuple; import net.minecraft.util.math.*; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.nio.file.Files; import java.util.*; import java.util.stream.Collectors; @@ -187,72 +187,15 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil //if java.lang.NoSuchMethodError is thrown see comment in SchematicPlacementManager if (LitematicaHelper.hasLoadedSchematic()) { String name = LitematicaHelper.getName(i); - File schemFile = LitematicaHelper.getSchematicFile(i); - Vec3i origin = LitematicaHelper.getOrigin(i); - - - - try { - LitematicaSchematic herbert = new LitematicaSchematic(CompressedStreamTools.readCompressed(new FileInputStream(schemFile))); - LitematicaSchematic volker_rainer_fahrenhorst = new LitematicaSchematic(CompressedStreamTools.readCompressed(new FileInputStream(schemFile))); + LitematicaSchematic schematic = new LitematicaSchematic(CompressedStreamTools.readCompressed(Files.newInputStream(LitematicaHelper.getSchematicFile(i).toPath()))); + schematic = LitematicaHelper.blackMagicFuckery(schematic, i); + Vec3i correctedOrigin = LitematicaHelper.getCorrectedOrigin(LitematicaHelper.getOrigin(i), schematic.getMinimumCorner()); - net.minecraft.util.Rotation rotation = LitematicaHelper.getRotation(i); - net.minecraft.util.Mirror mirror = LitematicaHelper.getMirror(i); - - - Vec3i gustav = herbert.getMinimumCorner(); - Vec3i martin = new Vec3i(origin.getX()+gustav.getX(),origin.getY()+gustav.getY(),origin.getZ()+gustav.getZ()); - int xena = herbert.getX(); - int yvonne = herbert.getY(); - int zuse = herbert.getZ(); - - for (int brian=0; brian