Merge branch 'master' into mapping

This commit is contained in:
Howard Stark 2018-08-21 21:21:40 -07:00
commit 01bb5f1712
No known key found for this signature in database
GPG Key ID: 9FA4E350B33067F3

View File

@ -18,11 +18,13 @@
package baritone.launch.mixins;
import baritone.bot.Baritone;
import baritone.bot.behavior.impl.PathingBehavior;
import baritone.bot.event.events.TickEvent;
import baritone.bot.event.events.WorldEvent;
import baritone.bot.event.events.type.EventState;
import baritone.bot.utils.ExampleBaritoneControl;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.multiplayer.WorldClient;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
@ -31,6 +33,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
/**
* @author Brady
@ -141,4 +144,16 @@ public class MixinMinecraft {
)
);
}
@Redirect(
method = "runTick",
at = @At(
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "net/minecraft/client/gui/GuiScreen.allowUserInput:Z"
)
)
private boolean isAllowUserInput(GuiScreen screen) {
return PathingBehavior.INSTANCE.getCurrent() != null || screen.allowUserInput;
}
}