diff --git a/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java b/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java index 4d769a1..6f2da90 100644 --- a/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java +++ b/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java @@ -2,6 +2,7 @@ package ftbsc.bscv.modules.motion; import com.google.auto.service.AutoService; +import ftbsc.bscv.Boscovicino; import ftbsc.bscv.api.ILoadable; import ftbsc.bscv.modules.AbstractModule; import ftbsc.bscv.patches.BackgroundPatch.RenderBackgroundEvent; @@ -29,6 +30,8 @@ public class GuiMove extends AbstractModule { public final ForgeConfigSpec.ConfigValue background; + private AutoWalk autoWalk_mod; + public GuiMove() { super(); @@ -39,6 +42,12 @@ public class GuiMove extends AbstractModule { .build(this); } + @Override + public void enable() { + this.autoWalk_mod = (AutoWalk) Boscovicino.modManager.get(AutoWalk.class); + super.enable(); + } + private boolean isKeyDown(KeyBinding key) { return InputMappings.isKeyDown(MC.getWindow().getWindow(), key.getKey().getValue()); } @@ -63,7 +72,7 @@ public class GuiMove extends AbstractModule { private void forceMovementTick(MovementInput input) { // TODO can we patch to make this always happen instead of duplicating code? - input.up = this.isKeyDown(MC.options.keyUp); + input.up = this.autoWalk_mod.isEnabled() || this.isKeyDown(MC.options.keyUp); input.down = this.isKeyDown(MC.options.keyDown); input.left = this.isKeyDown(MC.options.keyLeft); input.right = this.isKeyDown(MC.options.keyRight);