customized TickEvent Type based on player context status
This commit is contained in:
parent
57b60c734b
commit
e93fd596ff
@ -86,12 +86,12 @@ public class MixinMinecraft {
|
|||||||
)
|
)
|
||||||
private void runTick(CallbackInfo ci) {
|
private void runTick(CallbackInfo ci) {
|
||||||
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
|
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
|
||||||
((Baritone) ibaritone).getGameEventHandler().onTick(new TickEvent(
|
|
||||||
EventState.PRE,
|
TickEvent.Type type = ibaritone.getPlayerContext().player() != null && ibaritone.getPlayerContext().world() != null
|
||||||
(player != null && world != null)
|
? TickEvent.Type.IN
|
||||||
? TickEvent.Type.IN
|
: TickEvent.Type.OUT;
|
||||||
: TickEvent.Type.OUT
|
|
||||||
));
|
((Baritone) ibaritone).getGameEventHandler().onTick(new TickEvent(EventState.PRE, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user