ChatScreenMixin: switch to KeyEvent param (MC 1.21.9+ input refactor)
This commit is contained in:
@@ -2,6 +2,7 @@ package ru.nevetime.clientirc.mixin;
|
||||
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.client.gui.screens.ChatScreen;
|
||||
import net.minecraft.client.input.KeyEvent;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -26,8 +27,8 @@ public abstract class ChatScreenMixin {
|
||||
};
|
||||
|
||||
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
|
||||
private void clientirc$tabComplete(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (keyCode != GLFW.GLFW_KEY_TAB) return;
|
||||
private void clientirc$tabComplete(KeyEvent event, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (event.key() != GLFW.GLFW_KEY_TAB) return;
|
||||
if (input == null) return;
|
||||
String value = input.getValue();
|
||||
if (value == null || !value.startsWith(".")) return;
|
||||
|
||||
Reference in New Issue
Block a user