From 1332dd573ef538e69bc7ba679dbb684a9207f056 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 6 Aug 2018 18:56:57 -0500 Subject: [PATCH] Fix onPlayerUpdate not being called --- src/main/java/baritone/bot/behavior/impl/LookBehavior.java | 6 ------ .../java/baritone/launch/mixins/MixinEntityPlayerSP.java | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/baritone/bot/behavior/impl/LookBehavior.java b/src/main/java/baritone/bot/behavior/impl/LookBehavior.java index bde030b0..036a7f53 100644 --- a/src/main/java/baritone/bot/behavior/impl/LookBehavior.java +++ b/src/main/java/baritone/bot/behavior/impl/LookBehavior.java @@ -1,7 +1,6 @@ package baritone.bot.behavior.impl; import baritone.bot.behavior.Behavior; -import baritone.bot.event.events.TickEvent; import baritone.bot.utils.Rotation; public class LookBehavior extends Behavior { @@ -22,11 +21,6 @@ public class LookBehavior extends Behavior { this.target = target; } - @Override - public void onTick(TickEvent event) { - this.onPlayerUpdate(); - } - @Override public void onPlayerUpdate() { if (target != null) { diff --git a/src/main/java/baritone/launch/mixins/MixinEntityPlayerSP.java b/src/main/java/baritone/launch/mixins/MixinEntityPlayerSP.java index d99cdbc9..dc2a01ed 100644 --- a/src/main/java/baritone/launch/mixins/MixinEntityPlayerSP.java +++ b/src/main/java/baritone/launch/mixins/MixinEntityPlayerSP.java @@ -30,8 +30,10 @@ public class MixinEntityPlayerSP { @Inject( method = "onUpdate", at = @At( - value = "INVOKE_ASSIGN", - target = "Lnet/minecraft/client/entity/AbstractClientPlayer;onUpdate()V" + value = "INVOKE", + target = "net/minecraft/client/entity/EntityPlayerSP.isRiding()Z", + shift = At.Shift.BY, + by = -3 ) ) private void onUpdate(CallbackInfo ci) {