From e93fd596ff64c6f9be3f64c09fc6e4d028af6fc1 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 13 Nov 2018 22:17:18 -0800 Subject: [PATCH] customized TickEvent Type based on player context status --- .../java/baritone/launch/mixins/MixinMinecraft.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/launch/java/baritone/launch/mixins/MixinMinecraft.java b/src/launch/java/baritone/launch/mixins/MixinMinecraft.java index 50ba4178..303a53b1 100644 --- a/src/launch/java/baritone/launch/mixins/MixinMinecraft.java +++ b/src/launch/java/baritone/launch/mixins/MixinMinecraft.java @@ -86,12 +86,12 @@ public class MixinMinecraft { ) private void runTick(CallbackInfo ci) { for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) { - ((Baritone) ibaritone).getGameEventHandler().onTick(new TickEvent( - EventState.PRE, - (player != null && world != null) - ? TickEvent.Type.IN - : TickEvent.Type.OUT - )); + + TickEvent.Type type = ibaritone.getPlayerContext().player() != null && ibaritone.getPlayerContext().world() != null + ? TickEvent.Type.IN + : TickEvent.Type.OUT; + + ((Baritone) ibaritone).getGameEventHandler().onTick(new TickEvent(EventState.PRE, type)); } }