From 94bf8d4bbdf3c6116bdfc3fba6f6ab8f60599cef Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 13 Nov 2018 16:53:13 -0600 Subject: [PATCH] More review things --- .../java/baritone/api/utils/input/Input.java | 8 ++++ .../movement/movements/MovementParkour.java | 2 +- src/main/java/baritone/utils/Helper.java | 44 ------------------- 3 files changed, 9 insertions(+), 45 deletions(-) diff --git a/src/api/java/baritone/api/utils/input/Input.java b/src/api/java/baritone/api/utils/input/Input.java index 4abc0544..1e8d44b5 100644 --- a/src/api/java/baritone/api/utils/input/Input.java +++ b/src/api/java/baritone/api/utils/input/Input.java @@ -89,6 +89,14 @@ public enum Input { private final KeyBinding keyBinding; Input(Function keyBindingMapper) { + /* + + Here, a Function is used because referring to a static field in this enum for the game instance, + as it was before, wouldn't be possible in an Enum constructor unless the static field was in an + interface that this class implemented. (Helper acted as this interface) I didn't feel like making + an interface with a game instance field just to not have to do this. + + */ this.keyBinding = keyBindingMapper.apply(Minecraft.getMinecraft().gameSettings); } diff --git a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java index 9859f9ad..71fba81a 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java @@ -45,7 +45,7 @@ import java.util.Objects; public class MovementParkour extends Movement { - private static final EnumFacing[] HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP = { EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.DOWN }; + private static final EnumFacing[] HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP = { EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.DOWN }; private static final BetterBlockPos[] EMPTY = new BetterBlockPos[]{}; private final EnumFacing direction; diff --git a/src/main/java/baritone/utils/Helper.java b/src/main/java/baritone/utils/Helper.java index 2429757a..196ede30 100755 --- a/src/main/java/baritone/utils/Helper.java +++ b/src/main/java/baritone/utils/Helper.java @@ -44,50 +44,6 @@ public interface Helper { Minecraft mc = Minecraft.getMinecraft(); - /* - default EntityPlayerSP player() { - if (!mc.isCallingFromMinecraftThread()) { - throw new IllegalStateException("h00000000"); - } - return mc.player; - } - - default PlayerControllerMP playerController() { // idk - if (!mc.isCallingFromMinecraftThread()) { - throw new IllegalStateException("h00000000"); - } - return mc.playerController; - } - - default WorldClient world() { - if (!mc.isCallingFromMinecraftThread()) { - throw new IllegalStateException("h00000000"); - } - return mc.world; - } - - default BetterBlockPos playerFeet() { - // TODO find a better way to deal with soul sand!!!!! - BetterBlockPos feet = new BetterBlockPos(player().posX, player().posY + 0.1251, player().posZ); - if (BlockStateInterface.get(feet).getBlock() instanceof BlockSlab) { - return feet.up(); - } - return feet; - } - - default Vec3d playerFeetAsVec() { - return new Vec3d(player().posX, player().posY, player().posZ); - } - - default Vec3d playerHead() { - return new Vec3d(player().posX, player().posY + player().getEyeHeight(), player().posZ); - } - - default Rotation playerRotations() { - return new Rotation(player().rotationYaw, player().rotationPitch); - } - */ - /** * Send a message to chat only if chatDebug is on *