From d505ec4f9f031a982d2c93ef40d675e396be75d9 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 21 Jul 2019 20:54:02 -0400 Subject: [PATCH 1/8] build the schematic schematica has open --- build.gradle | 8 +++ scripts/proguard.pro | 5 ++ .../baritone/api/process/IBuilderProcess.java | 2 + .../api/utils/ExampleBaritoneControl.java | 4 ++ .../java/baritone/process/BuilderProcess.java | 15 ++++++ .../schematica/SchematicAdapter.java | 54 +++++++++++++++++++ .../schematica/SchematicaHelper.java | 50 +++++++++++++++++ .../lunatrius/core/util/math/MBlockPos.java | 30 +++++++++++ .../lunatrius/schematica/Schematica.java | 24 +++++++++ .../lunatrius/schematica/api/ISchematic.java | 31 +++++++++++ .../client/world/SchematicWorld.java | 32 +++++++++++ .../schematica/proxy/ClientProxy.java | 29 ++++++++++ .../schematica/proxy/CommonProxy.java | 20 +++++++ 13 files changed, 304 insertions(+) create mode 100644 src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java create mode 100644 src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java create mode 100644 src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java create mode 100644 src/schematica_api/java/com/github/lunatrius/schematica/Schematica.java create mode 100644 src/schematica_api/java/com/github/lunatrius/schematica/api/ISchematic.java create mode 100644 src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java create mode 100644 src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java create mode 100644 src/schematica_api/java/com/github/lunatrius/schematica/proxy/CommonProxy.java diff --git a/build.gradle b/build.gradle index 00e35617..1264f0fe 100755 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,14 @@ sourceSets { launch { compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output } + + schematica_api { + compileClasspath += main.compileClasspath + } + + main { + compileClasspath += schematica_api.output + } } minecraft { diff --git a/scripts/proguard.pro b/scripts/proguard.pro index bb8df2ae..2e10986d 100644 --- a/scripts/proguard.pro +++ b/scripts/proguard.pro @@ -31,6 +31,11 @@ # need to keep mixin names -keep class baritone.launch.** { *; } +#try to keep usage of schematica in separate classes +-keep class baritone.utils.schematic.schematica.* +#proguard doesnt like it when it cant find our fake schematica classes +-dontwarn baritone.utils.schematic.schematica.* + # copy all necessary libraries into tempLibraries to build # The correct jar will be copied from the forgegradle cache based on the mapping type being compiled with diff --git a/src/api/java/baritone/api/process/IBuilderProcess.java b/src/api/java/baritone/api/process/IBuilderProcess.java index d9397786..f73f0e74 100644 --- a/src/api/java/baritone/api/process/IBuilderProcess.java +++ b/src/api/java/baritone/api/process/IBuilderProcess.java @@ -54,6 +54,8 @@ public interface IBuilderProcess extends IBaritoneProcess { return build(schematicFile, file, origin); } + void buildOpenSchematic(); + void pause(); void resume(); diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 96d6ad2f..46300150 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -295,6 +295,10 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener logDirect(success ? "Loaded" : "Unable to load"); return true; } + if (msg.startsWith("schematica")) { + baritone.getBuilderProcess().buildOpenSchematic(); + return true; + } if (msg.equals("come")) { customGoalProcess.setGoalAndPath(new GoalBlock(new BlockPos(Helper.mc.getRenderViewEntity()))); logDirect("Coming"); diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index 52f21b76..5317c39a 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -35,6 +35,7 @@ import baritone.utils.BlockStateInterface; import baritone.utils.PathingCommandContext; import baritone.utils.schematic.AirSchematic; import baritone.utils.schematic.Schematic; +import baritone.utils.schematic.schematica.SchematicaHelper; import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.minecraft.block.BlockAir; import net.minecraft.block.BlockLiquid; @@ -106,6 +107,20 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil return true; } + @Override + public void buildOpenSchematic() { + if (SchematicaHelper.isSchematicaPresent()) { + Optional> schematic = SchematicaHelper.getOpenSchematic(); + if (schematic.isPresent()) { + this.build(schematic.get().getFirst().toString(), schematic.get().getFirst(), schematic.get().getSecond()); + } else { + logDirect("No schematic currently open"); + } + } else { + logDirect("Schematica is not present"); + } + } + public void clearArea(BlockPos corner1, BlockPos corner2) { BlockPos origin = new BlockPos(Math.min(corner1.getX(), corner2.getX()), Math.min(corner1.getY(), corner2.getY()), Math.min(corner1.getZ(), corner2.getZ())); int widthX = Math.abs(corner1.getX() - corner2.getX()) + 1; diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java b/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java new file mode 100644 index 00000000..4e399348 --- /dev/null +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java @@ -0,0 +1,54 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package baritone.utils.schematic.schematica; + +import baritone.api.utils.ISchematic; + +import com.github.lunatrius.schematica.client.world.SchematicWorld; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; + +// TODO: this only works for the default rotation +public final class SchematicAdapter implements ISchematic { + private final SchematicWorld schematic; + + + public SchematicAdapter(SchematicWorld schematicWorld) { + this.schematic = schematicWorld; + } + + @Override + public IBlockState desiredState(int x, int y, int z) { + return schematic.getSchematic().getBlockState(new BlockPos(x, y, z)); + } + + @Override + public int widthX() { + return schematic.getSchematic().getWidth(); + } + + @Override + public int heightY() { + return schematic.getSchematic().getHeight(); + } + + @Override + public int lengthZ() { + return schematic.getSchematic().getLength(); + } +} diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java new file mode 100644 index 00000000..bf5d4678 --- /dev/null +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java @@ -0,0 +1,50 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package baritone.utils.schematic.schematica; + +import baritone.api.utils.ISchematic; +import com.github.lunatrius.core.util.math.MBlockPos; +import com.github.lunatrius.schematica.Schematica; +import com.github.lunatrius.schematica.proxy.ClientProxy; +import net.minecraft.util.Tuple; +import net.minecraft.util.math.BlockPos; + +import java.util.Optional; + +public enum SchematicaHelper { + ; + + public static boolean isSchematicaPresent() { + try { + Class.forName(Schematica.class.getName()); + return true; + } catch (ClassNotFoundException ex) { + return false; + } + } + + public static Optional> getOpenSchematic() { + return Optional.ofNullable(ClientProxy.schematic) + .map(world -> { + MBlockPos poz = world.position; + return new Tuple<>(new SchematicAdapter(world), new BlockPos(poz.field_177962_a, poz.field_177960_b, poz.field_177961_c)); + }); + } + + private static void meme(Class clazz) throws ClassNotFoundException {} +} diff --git a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java new file mode 100644 index 00000000..60cf6fae --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java @@ -0,0 +1,30 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.core.util.math; + +import net.minecraft.util.math.BlockPos; + +public class MBlockPos extends BlockPos { + public int field_177962_a; // x + public int field_177960_b; // y + public int field_177961_c; // z + + private MBlockPos() { + super(6, 6, 6); + } +} diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/Schematica.java b/src/schematica_api/java/com/github/lunatrius/schematica/Schematica.java new file mode 100644 index 00000000..7d786dbd --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/schematica/Schematica.java @@ -0,0 +1,24 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.schematica; + +import com.github.lunatrius.schematica.proxy.CommonProxy; + +public class Schematica { + public static CommonProxy proxy; +} diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/api/ISchematic.java b/src/schematica_api/java/com/github/lunatrius/schematica/api/ISchematic.java new file mode 100644 index 00000000..6430dbfc --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/schematica/api/ISchematic.java @@ -0,0 +1,31 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.schematica.api; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; + +public interface ISchematic { + IBlockState getBlockState(BlockPos var1); + + int getWidth(); + + int getHeight(); + + int getLength(); +} diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java b/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java new file mode 100644 index 00000000..fc4b89f9 --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java @@ -0,0 +1,32 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.schematica.client.world; + +import com.github.lunatrius.core.util.math.MBlockPos; +import com.github.lunatrius.schematica.api.ISchematic; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; + +public class SchematicWorld { + private ISchematic schematic; + public final MBlockPos position = (MBlockPos)(Object)"cringe"; + + public ISchematic getSchematic() { + throw new LinkageError("LOL"); + } +} diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java new file mode 100644 index 00000000..e58e76b5 --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java @@ -0,0 +1,29 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.schematica.proxy; + +import com.github.lunatrius.schematica.client.world.SchematicWorld; +import net.minecraft.util.EnumFacing; + +public class ClientProxy extends CommonProxy { + public static SchematicWorld schematic; + + public static EnumFacing orientation; + public static EnumFacing axisFlip; + public static EnumFacing axisRotation; +} diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/proxy/CommonProxy.java b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/CommonProxy.java new file mode 100644 index 00000000..eb3c034e --- /dev/null +++ b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/CommonProxy.java @@ -0,0 +1,20 @@ +/* + * This file is part of Baritone. + * + * Baritone is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Baritone is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Baritone. If not, see . + */ + +package com.github.lunatrius.schematica.proxy; + +public abstract class CommonProxy {} From 074ec333cf49a9382e7e8141aeb8717abc18243d Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 21 Jul 2019 21:57:59 -0400 Subject: [PATCH 2/8] clean up a bit --- scripts/proguard.pro | 4 ++-- .../baritone/utils/schematic/schematica/SchematicAdapter.java | 2 -- .../baritone/utils/schematic/schematica/SchematicaHelper.java | 1 - .../lunatrius/schematica/client/world/SchematicWorld.java | 3 --- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/proguard.pro b/scripts/proguard.pro index 2e10986d..4ac0f723 100644 --- a/scripts/proguard.pro +++ b/scripts/proguard.pro @@ -32,9 +32,9 @@ -keep class baritone.launch.** { *; } #try to keep usage of schematica in separate classes --keep class baritone.utils.schematic.schematica.* +-keep class baritone.utils.schematic.schematica.** #proguard doesnt like it when it cant find our fake schematica classes --dontwarn baritone.utils.schematic.schematica.* +-dontwarn baritone.utils.schematic.schematica.** # copy all necessary libraries into tempLibraries to build diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java b/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java index 4e399348..fd0ace8c 100644 --- a/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicAdapter.java @@ -23,11 +23,9 @@ import com.github.lunatrius.schematica.client.world.SchematicWorld; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; -// TODO: this only works for the default rotation public final class SchematicAdapter implements ISchematic { private final SchematicWorld schematic; - public SchematicAdapter(SchematicWorld schematicWorld) { this.schematic = schematicWorld; } diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java index bf5d4678..e929d081 100644 --- a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java @@ -46,5 +46,4 @@ public enum SchematicaHelper { }); } - private static void meme(Class clazz) throws ClassNotFoundException {} } diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java b/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java index fc4b89f9..80c1b2a2 100644 --- a/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java +++ b/src/schematica_api/java/com/github/lunatrius/schematica/client/world/SchematicWorld.java @@ -19,11 +19,8 @@ package com.github.lunatrius.schematica.client.world; import com.github.lunatrius.core.util.math.MBlockPos; import com.github.lunatrius.schematica.api.ISchematic; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; public class SchematicWorld { - private ISchematic schematic; public final MBlockPos position = (MBlockPos)(Object)"cringe"; public ISchematic getSchematic() { From 8bf977060e1c379b130d02e08b59f5d6bf4147bf Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 21 Jul 2019 22:06:36 -0400 Subject: [PATCH 3/8] dont need the fields --- .../baritone/utils/schematic/schematica/SchematicaHelper.java | 2 +- .../java/com/github/lunatrius/core/util/math/MBlockPos.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java index e929d081..9120c5ac 100644 --- a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java @@ -42,7 +42,7 @@ public enum SchematicaHelper { return Optional.ofNullable(ClientProxy.schematic) .map(world -> { MBlockPos poz = world.position; - return new Tuple<>(new SchematicAdapter(world), new BlockPos(poz.field_177962_a, poz.field_177960_b, poz.field_177961_c)); + return new Tuple<>(new SchematicAdapter(world), new BlockPos(poz.getX(), poz.getY(), poz.getZ())); }); } diff --git a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java index 60cf6fae..338e3be4 100644 --- a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java +++ b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java @@ -20,10 +20,6 @@ package com.github.lunatrius.core.util.math; import net.minecraft.util.math.BlockPos; public class MBlockPos extends BlockPos { - public int field_177962_a; // x - public int field_177960_b; // y - public int field_177961_c; // z - private MBlockPos() { super(6, 6, 6); } From 21e9c0b7c11f158e4f47d474defd7f939a9110af Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 21 Jul 2019 22:17:21 -0400 Subject: [PATCH 4/8] add get functions --- .../lunatrius/core/util/math/MBlockPos.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java index 338e3be4..80c296cc 100644 --- a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java +++ b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java @@ -23,4 +23,19 @@ public class MBlockPos extends BlockPos { private MBlockPos() { super(6, 6, 6); } + + @Override + public int getX() { + throw new LinkageError("LOL"); + } + + @Override + public int getY() { + throw new LinkageError("LOL"); + } + + @Override + public int getZ() { + throw new LinkageError("LOL"); + } } From fe54372a5362a351155a3ad3193573aac37804a0 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 21 Jul 2019 22:33:22 -0400 Subject: [PATCH 5/8] resolve the issue --- .../java/com/github/lunatrius/core/util/math/MBlockPos.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java index 80c296cc..280b38a6 100644 --- a/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java +++ b/src/schematica_api/java/com/github/lunatrius/core/util/math/MBlockPos.java @@ -20,7 +20,7 @@ package com.github.lunatrius.core.util.math; import net.minecraft.util.math.BlockPos; public class MBlockPos extends BlockPos { - private MBlockPos() { + MBlockPos() { super(6, 6, 6); } From 61147536e59f6689e3e159b7c0bbcc5d7d1add15 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Mon, 22 Jul 2019 16:51:09 -0400 Subject: [PATCH 6/8] ok --- .../utils/schematic/schematica/SchematicaHelper.java | 6 +----- .../com/github/lunatrius/schematica/proxy/ClientProxy.java | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java index 9120c5ac..f7df0a4f 100644 --- a/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java +++ b/src/main/java/baritone/utils/schematic/schematica/SchematicaHelper.java @@ -18,7 +18,6 @@ package baritone.utils.schematic.schematica; import baritone.api.utils.ISchematic; -import com.github.lunatrius.core.util.math.MBlockPos; import com.github.lunatrius.schematica.Schematica; import com.github.lunatrius.schematica.proxy.ClientProxy; import net.minecraft.util.Tuple; @@ -40,10 +39,7 @@ public enum SchematicaHelper { public static Optional> getOpenSchematic() { return Optional.ofNullable(ClientProxy.schematic) - .map(world -> { - MBlockPos poz = world.position; - return new Tuple<>(new SchematicAdapter(world), new BlockPos(poz.getX(), poz.getY(), poz.getZ())); - }); + .map(world -> new Tuple<>(new SchematicAdapter(world), world.position)); } } diff --git a/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java index e58e76b5..191d0110 100644 --- a/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java +++ b/src/schematica_api/java/com/github/lunatrius/schematica/proxy/ClientProxy.java @@ -18,12 +18,7 @@ package com.github.lunatrius.schematica.proxy; import com.github.lunatrius.schematica.client.world.SchematicWorld; -import net.minecraft.util.EnumFacing; public class ClientProxy extends CommonProxy { public static SchematicWorld schematic; - - public static EnumFacing orientation; - public static EnumFacing axisFlip; - public static EnumFacing axisRotation; } From 784bc52d6df3dc7c1e494f8b34d6e4e5750e72b3 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Tue, 23 Jul 2019 02:46:53 -0400 Subject: [PATCH 7/8] add to usage.md --- USAGE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USAGE.md b/USAGE.md index f628d542..916adc72 100644 --- a/USAGE.md +++ b/USAGE.md @@ -28,6 +28,7 @@ Some common examples: - `follow playerName` to follow a player. `follow` to follow the entity you're looking at (only works if it hitting range). `followplayers` to follow any players in range (combine with Kill Aura for a fun time). - `save waypointName` to save a waypoint. `goto waypointName` to go to it. - `build` to build a schematic. `build blah` will load `schematics/blah.schematic` and build it with the origin being your player feet. `build blah x y z` to set the origin. Any of those can be relative to your player (`~ 69 ~-420` would build at x=player x, y=69, z=player z-420). +- 'schematica' to build the schematic that is currently open in schematica - `tunnel` to dig just straight ahead and make a tunnel - `farm` to automatically harvest, replant, or bone meal crops - `axis` to go to an axis or diagonal axis at y=120 (`axisHeight` is a configurable setting, defaults to 120). From 821e73c1d34b44c1e801fb34ebf502db7ae68060 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Tue, 23 Jul 2019 02:48:40 -0400 Subject: [PATCH 8/8] fix usage.md --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index 916adc72..865670b6 100644 --- a/USAGE.md +++ b/USAGE.md @@ -28,7 +28,7 @@ Some common examples: - `follow playerName` to follow a player. `follow` to follow the entity you're looking at (only works if it hitting range). `followplayers` to follow any players in range (combine with Kill Aura for a fun time). - `save waypointName` to save a waypoint. `goto waypointName` to go to it. - `build` to build a schematic. `build blah` will load `schematics/blah.schematic` and build it with the origin being your player feet. `build blah x y z` to set the origin. Any of those can be relative to your player (`~ 69 ~-420` would build at x=player x, y=69, z=player z-420). -- 'schematica' to build the schematic that is currently open in schematica +- `schematica` to build the schematic that is currently open in schematica - `tunnel` to dig just straight ahead and make a tunnel - `farm` to automatically harvest, replant, or bone meal crops - `axis` to go to an axis or diagonal axis at y=120 (`axisHeight` is a configurable setting, defaults to 120).