From d254e5834d0fabfea97e0be511b509b016023abe Mon Sep 17 00:00:00 2001 From: KoSHeroff Date: Sun, 26 Jul 2026 20:23:45 +0500 Subject: [PATCH 1/2] fix: inject MouseHandler.onButton on NeoForge 1.21.5+ The mouse button handler was renamed onPress -> onButton(MouseButtonInfo) in 1.21.5. MouseMixin only used onButton for >=26, so on NeoForge 1.21.11 the injector could not find onPress and crashed at startup. Widen the neoforge branch guard from >=26 to >=1.21.5. --- src/main/java/land/webgui/mixin/MouseMixin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/land/webgui/mixin/MouseMixin.java b/src/main/java/land/webgui/mixin/MouseMixin.java index e49da81..ee3898e 100644 --- a/src/main/java/land/webgui/mixin/MouseMixin.java +++ b/src/main/java/land/webgui/mixin/MouseMixin.java @@ -9,7 +9,7 @@ //? } else { /*import net.minecraft.client.Minecraft; import net.minecraft.client.MouseHandler; -//? if >=26 { +//? if >=1.21.5 { import net.minecraft.client.input.MouseButtonInfo; //? }*/ //? } @@ -36,7 +36,7 @@ public class MouseMixin { @Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true) private void webgui$cancelVanillaForWebHudPseudoGui(long window, MouseInput input, int action, CallbackInfo ci) { //? } else { - /*//? if >=26 { + /*//? if >=1.21.5 { @Inject(method = "onButton", at = @At("HEAD"), cancellable = true) private void webgui$cancelVanillaForWebHudPseudoGui(long window, MouseButtonInfo rawButtonInfo, int action, CallbackInfo ci) { //? } else { @@ -106,7 +106,7 @@ public class MouseMixin { browser.sendMouseRelease(lx, ly, input.button()); } //? } else { - /*//? if >=26 { + /*//? if >=1.21.5 { if (action == GLFW.GLFW_PRESS) { browser.sendMousePress(lx, ly, rawButtonInfo.button()); } else if (action == GLFW.GLFW_RELEASE) { From dcefab60df26128f5669789e18aaf116237c3b3d Mon Sep 17 00:00:00 2001 From: KoSHeroff Date: Sun, 26 Jul 2026 20:32:10 +0500 Subject: [PATCH 2/2] release: 1.6.1 Bump mod_version to 1.6.1 and add changelog for the NeoForge 1.21.11 MouseMixin (onButton) startup-crash fix. --- CHANGELOG.md | 5 +++++ gradle.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 425ae35..6473051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.6.1 - 2026-07-26 + +### Fixed +- Fixed a NeoForge 1.21.11 startup crash: `MouseMixin` still targeted the removed `MouseHandler.onPress`; it now injects into `onButton` on 1.21.5+. + ## 1.6.0 - 2026-07-25 ### Added diff --git a/gradle.properties b/gradle.properties index 6627fba..2c9a77c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx4G org.gradle.parallel=true dev.kikugie.stonecutter.hard_mode=true -mod_version=1.6.0 +mod_version=1.6.1 maven_group=land.webgui archives_base_name=webgui