From 82417f4f851f62674d63450f193d1a0b1612eb90 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 22 Oct 2018 12:42:08 -0700 Subject: [PATCH] comment to explain weird thing --- .../java/baritone/launch/mixins/MixinEntityLivingBase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/launch/java/baritone/launch/mixins/MixinEntityLivingBase.java b/src/launch/java/baritone/launch/mixins/MixinEntityLivingBase.java index d2701cff..6313b3a1 100644 --- a/src/launch/java/baritone/launch/mixins/MixinEntityLivingBase.java +++ b/src/launch/java/baritone/launch/mixins/MixinEntityLivingBase.java @@ -40,6 +40,8 @@ public class MixinEntityLivingBase { ) private void preJump(CallbackInfo ci) { EntityLivingBase _this = (EntityLivingBase) (Object) this; + // This uses Class.isInstance instead of instanceof since proguard optimizes out the instanceof (since MixinEntityLivingBase could never be instanceof EntityLivingBase in normal java) + // but proguard isn't smart enough to optimize out this Class.isInstance =) if (EntityPlayerSP.class.isInstance(_this)) Baritone.INSTANCE.getGameEventHandler().onPlayerRotationMove(new RotationMoveEvent((EntityPlayerSP) _this, EventState.PRE, RotationMoveEvent.Type.JUMP)); } @@ -50,6 +52,7 @@ public class MixinEntityLivingBase { ) private void postJump(CallbackInfo ci) { EntityLivingBase _this = (EntityLivingBase) (Object) this; + // See above if (EntityPlayerSP.class.isInstance(_this)) Baritone.INSTANCE.getGameEventHandler().onPlayerRotationMove(new RotationMoveEvent((EntityPlayerSP) _this, EventState.POST, RotationMoveEvent.Type.JUMP)); }