// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/KeyboardCallback.java
// public interface KeyboardCallback {
//     Event<KeyboardCallback> EVENT = Event.create((listeners) ->
//             new KeyboardCallback() {
//                 @Override
//                 public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.keyPressed(keyCode, scanCode, modifiers)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
// 
//                 @Override
//                 public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.keyReleased(keyCode, scanCode, modifiers)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
// 
//                 @Override
//                 public boolean charTyped(char charCode, int scanCode) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.charTyped(charCode, scanCode)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
//             }
//     );
// 
//     boolean keyPressed(int keyCode, int scanCode, int modifiers);
//     boolean keyReleased(int keyCode, int scanCode, int modifiers);
//     boolean charTyped(char keyChar, int scanCode);
// }


import de.johni0702.minecraft.gui.versions.callbacks.KeyboardCallback;
import net.minecraft.client.Keyboard;
import net.minecraft.client.gui.Element;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Group;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.gui.ParentElement;
        }
    }

    @Inject(method = "method_1458", at = @At("HEAD"), cancellable = true)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-int")
    private static void charTyped(Element element, int keyChar, int modifiers, CallbackInfo ci) {
        if (KeyboardCallback.EVENT.invoker().charTyped((char) keyChar, modifiers)) {
            ci.cancel();
        }
    }

    @Inject(method = "lambda$onCharEvent$5", at = @At("HEAD"), cancellable = true, remap = false)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-int")
    private void charTypedOptifine(int keyChar, int modifiers, Element element, CallbackInfo ci) {
        if (KeyboardCallback.EVENT.invoker().charTyped((char) keyChar, modifiers)) {
            ci.cancel();
        }
   }

   @Inject(method = "method_1473", at = @At("HEAD"), cancellable = true)
   @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-char")
   private static void charTyped(Element element, char keyChar, int modifiers, CallbackInfo ci) {
       if (KeyboardCallback.EVENT.invoker().charTyped(keyChar, modifiers)) {
           ci.cancel();
       }
   }

    @Inject(method = "lambda$onCharEvent$6", at = @At("HEAD"), cancellable = true, remap = false)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-char")
    private void charTypedOptifine(char keyChar, int modifiers, Element element, CallbackInfo ci) {
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/KeyboardCallback.java
// public interface KeyboardCallback {
//     Event<KeyboardCallback> EVENT = Event.create((listeners) ->
//             new KeyboardCallback() {
//                 @Override
//                 public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.keyPressed(keyCode, scanCode, modifiers)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
// 
//                 @Override
//                 public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.keyReleased(keyCode, scanCode, modifiers)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
// 
//                 @Override
//                 public boolean charTyped(char charCode, int scanCode) {
//                     for (KeyboardCallback listener : listeners) {
//                         if (listener.charTyped(charCode, scanCode)) {
//                             return true;
//                         }
//                     }
//                     return false;
//                 }
//             }
//     );
// 
//     boolean keyPressed(int keyCode, int scanCode, int modifiers);
//     boolean keyReleased(int keyCode, int scanCode, int modifiers);
//     boolean charTyped(char keyChar, int scanCode);
// }


// Path: src/main/java/de/johni0702/minecraft/gui/versions/mixin/MixinKeyboardListener.java
import de.johni0702.minecraft.gui.versions.callbacks.KeyboardCallback;
import net.minecraft.client.Keyboard;
import net.minecraft.client.gui.Element;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Group;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.gui.ParentElement;

        }
    }

    @Inject(method = "method_1458", at = @At("HEAD"), cancellable = true)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-int")
    private static void charTyped(Element element, int keyChar, int modifiers, CallbackInfo ci) {
        if (KeyboardCallback.EVENT.invoker().charTyped((char) keyChar, modifiers)) {
            ci.cancel();
        }
    }

    @Inject(method = "lambda$onCharEvent$5", at = @At("HEAD"), cancellable = true, remap = false)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-int")
    private void charTypedOptifine(int keyChar, int modifiers, Element element, CallbackInfo ci) {
        if (KeyboardCallback.EVENT.invoker().charTyped((char) keyChar, modifiers)) {
            ci.cancel();
        }
   }

   @Inject(method = "method_1473", at = @At("HEAD"), cancellable = true)
   @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-char")
   private static void charTyped(Element element, char keyChar, int modifiers, CallbackInfo ci) {
       if (KeyboardCallback.EVENT.invoker().charTyped(keyChar, modifiers)) {
           ci.cancel();
       }
   }

    @Inject(method = "lambda$onCharEvent$6", at = @At("HEAD"), cancellable = true, remap = false)
    @Group(min = 1, max = 1, name = "replaymod-jgui-charTyped-char")
    private void charTypedOptifine(char keyChar, int modifiers, Element element, CallbackInfo ci) {
        if (KeyboardCallback.EVENT.invoker().charTyped(keyChar, modifiers)) {