ChatScreenMixin: switch to KeyEvent param (MC 1.21.9+ input refactor)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
2026-06-24 13:30:19 +06:00
parent db20575681
commit b918b79fd5

View File

@@ -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;