From c68367b865c156e3a1df566798e0950a1939e429 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 1 Aug 2018 14:44:19 -0400 Subject: [PATCH] works --- src/main/java/baritone/Baritone.java | 1 + .../java/baritone/movement/MovementManager.java | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/Baritone.java b/src/main/java/baritone/Baritone.java index 34b90cc5..a266a5a7 100644 --- a/src/main/java/baritone/Baritone.java +++ b/src/main/java/baritone/Baritone.java @@ -237,6 +237,7 @@ public class Baritone { } } Manager.tick(LookManager.class, false); + MovementManager.tick(); } public static boolean isPathFinding() { diff --git a/src/main/java/baritone/movement/MovementManager.java b/src/main/java/baritone/movement/MovementManager.java index 9546e4e1..1468d18b 100644 --- a/src/main/java/baritone/movement/MovementManager.java +++ b/src/main/java/baritone/movement/MovementManager.java @@ -6,6 +6,7 @@ package baritone.movement; import baritone.Baritone; +import baritone.bot.InputOverrideHandler; import baritone.ui.LookManager; import net.minecraft.block.BlockLadder; import net.minecraft.block.BlockVine; @@ -130,6 +131,17 @@ public class MovementManager { return isRightClick && rightPressTime >= -2; } + public static void tick(){ + InputOverrideHandler handler = baritone.bot.Baritone.INSTANCE.getInputOverrideHandler(); + handler.setInputForceState(InputOverrideHandler.Input.CLICK_LEFT, isLeftClick); + handler.setInputForceState(InputOverrideHandler.Input.CLICK_RIGHT, isRightClick); + handler.setInputForceState(InputOverrideHandler.Input.MOVE_FORWARD, forward); + handler.setInputForceState(InputOverrideHandler.Input.MOVE_BACK, backward); + handler.setInputForceState(InputOverrideHandler.Input.MOVE_LEFT, left); + handler.setInputForceState(InputOverrideHandler.Input.MOVE_RIGHT, right); + handler.setInputForceState(InputOverrideHandler.Input.JUMP, jumping); + } + public static boolean moveTowardsCoords(double x, double y, double z) { return moveTowardsCoords(x, y, z, true); } @@ -215,7 +227,9 @@ public class MovementManager { } public static void rightClickMouse() { + isRightClick=true; + //TODO fix //Minecraft.getMinecraft().rightClickMouse(); - throw new UnsupportedOperationException("Not public"); + //throw new UnsupportedOperationException("Not public"); } }