Add player null check to our allowUserInput hook, fixes #81
This commit is contained in:
parent
e85f439c0f
commit
40545c0c5d
@ -25,6 +25,7 @@ import baritone.event.events.WorldEvent;
|
|||||||
import baritone.event.events.type.EventState;
|
import baritone.event.events.type.EventState;
|
||||||
import baritone.utils.ExampleBaritoneControl;
|
import baritone.utils.ExampleBaritoneControl;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -48,6 +49,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||||||
public class MixinMinecraft {
|
public class MixinMinecraft {
|
||||||
|
|
||||||
@Shadow private int leftClickCounter;
|
@Shadow private int leftClickCounter;
|
||||||
|
@Shadow public EntityPlayerSP player;
|
||||||
@Shadow public WorldClient world;
|
@Shadow public WorldClient world;
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
@ -160,7 +162,7 @@ public class MixinMinecraft {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
private boolean isAllowUserInput(GuiScreen screen) {
|
private boolean isAllowUserInput(GuiScreen screen) {
|
||||||
return PathingBehavior.INSTANCE.getCurrent() != null || screen.allowUserInput;
|
return (PathingBehavior.INSTANCE.getCurrent() != null && player != null) || screen.allowUserInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user