stuff
This commit is contained in:
parent
48547a2c66
commit
dc1e189d38
25 changed files with 259 additions and 157 deletions
|
|
@ -8,6 +8,8 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import me.kawaiizenbo.moonlight.module.Module;
|
||||
import me.kawaiizenbo.moonlight.module.ModuleManager;
|
||||
import me.kawaiizenbo.moonlight.ui.clickgui.ClickGUIScreen;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
|
@ -17,7 +19,18 @@ public abstract class KeyboardMixin {
|
|||
@Shadow @Final private MinecraftClient client;
|
||||
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
public void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo info) {
|
||||
public void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo info)
|
||||
{
|
||||
System.out.println("Keyboard event occured: " + java.awt.event.KeyEvent.getKeyText(key) + " (keycode "+key+")");
|
||||
if (key == GLFW.GLFW_KEY_RIGHT_ALT) MinecraftClient.getInstance().setScreen(ClickGUIScreen.INSTANCE);
|
||||
for (Module m : ModuleManager.INSTANCE.modules)
|
||||
{
|
||||
System.out.println("checking against module:" + m.name);
|
||||
if (key == m.keybind.value)
|
||||
{
|
||||
System.out.println("yup, we gotem :3");
|
||||
m.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue