Split off 1.12.2 overwrite from MixinKeyboardListener
This commit is contained in:
@@ -2,19 +2,12 @@ package com.replaymod.core.mixin;
|
||||
|
||||
import com.replaymod.core.events.KeyBindingEventCallback;
|
||||
import com.replaymod.core.events.KeyEventCallback;
|
||||
import net.minecraft.client.Keyboard;
|
||||
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.callback.CallbackInfo;
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.Keyboard;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.settings.KeyBinding;
|
||||
//$$ import org.lwjgl.input.Keyboard;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
@Mixin(Keyboard.class)
|
||||
public class MixinKeyboardListener {
|
||||
private static final String ON_KEY_PRESSED = "Lnet/minecraft/client/options/KeyBinding;onKeyPressed(Lnet/minecraft/client/util/InputUtil$Key;)V";
|
||||
@@ -31,21 +24,3 @@ public class MixinKeyboardListener {
|
||||
KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||
}
|
||||
}
|
||||
//#else
|
||||
//$$ @Mixin(KeyBinding.class)
|
||||
//$$ public class MixinKeyboardListener {
|
||||
//$$ @Inject(method = "onTick", at = @At("HEAD"), cancellable = true)
|
||||
//$$ private static void beforeKeyBindingTick(CallbackInfo ci) {
|
||||
//$$ int keyCode = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
|
||||
//$$ int action = Keyboard.getEventKeyState() ? KeyEventCallback.ACTION_PRESS : KeyEventCallback.ACTION_RELEASE;
|
||||
//$$ if (KeyEventCallback.EVENT.invoker().onKeyEvent(keyCode, 0, action, 0)) {
|
||||
//$$ ci.cancel();
|
||||
//$$ }
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ @Inject(method = "onTick", at = @At("RETURN"))
|
||||
//$$ private static void afterKeyBindingTick(CallbackInfo ci) {
|
||||
//$$ KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent();
|
||||
//$$ }
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
Reference in New Issue
Block a user