1
0
mirror of https://github.com/cabaletta/baritone synced 2024-12-18 13:15:13 +00:00
This commit is contained in:
Leijurv 2018-08-01 14:29:44 -04:00
parent d1e42a9bf0
commit 63c2b682ad
No known key found for this signature in database
GPG Key ID: 0936202430AE187C

View File

@ -1,10 +1,17 @@
package baritone.launch.mixins;
import baritone.bot.Baritone;
import baritone.util.ChatCommand;
import net.minecraft.client.gui.GuiScreen;
import java.util.List;
import org.spongepowered.asm.mixin.Mixin;
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;
import java.lang.reflect.InvocationTargetException;
/**
* @author Brady
@ -27,4 +34,16 @@ public class MixinGuiScreen {
private static boolean isKeyDown(int keyCode) {
return Baritone.INSTANCE.getInputOverrideHandler().isKeyDown(keyCode);
}
@Inject(method="sendChatMessage",at=@At("HEAD"))
public void sendChatMessage(String msg, CallbackInfo cir)
{
try {
ChatCommand.message(msg);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}