Skip to content

Commit 8ca5e2f

Browse files
committed
1.21.9 (neo)forge support
1 parent 818ddd7 commit 8ca5e2f

File tree

10 files changed

+43
-49
lines changed

10 files changed

+43
-49
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
changes:
2-
-
2+
- properly support 1.21.9+ (now including 1.21.11)
3+
- (neo)forge support

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
`kotlin-dsl`
3-
kotlin("jvm") version "2.1.20"
3+
kotlin("jvm") version "2.0.21"
44
}
55

66
repositories {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stonecutter {
2121
fun mc(loader: String, vararg versions: String) {
2222
for (version in versions) vers("$version-$loader", version)
2323
}
24-
mc("fabric", "1.16.5", "1.19", "1.19.3", "1.20.6", "1.21.9")
24+
mc("fabric", "1.16.5", "1.19", "1.19.3", "1.20.6")
2525
mc("forge", "1.16.5", "1.17.1", "1.18.2", "1.19", "1.19.2", "1.19.3", "1.20.1", "1.20.6") // cool forge mixin bs!!!!
2626
mc("neoforge", "1.20.4", "1.20.6", "1.21")
2727

src/main/java/net/notcoded/wayfix/mixin/KeyboardMixin.java

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
package net.notcoded.wayfix.mixin;
22

3+
import io.netty.util.internal.PlatformDependent;
34
import net.minecraft.client.Keyboard;
4-
5-
//? if >=1.21.9 {
6-
/*import net.minecraft.client.input.CharInput;
7-
import net.minecraft.client.input.SystemKeycodes;
8-
*///?} else if <1.21.9 {
9-
import net.minecraft.client.gui.screen.Screen;
10-
import net.minecraft.client.util.InputUtil;
11-
//?}
5+
import net.minecraft.client.MinecraftClient;
126
import org.lwjgl.glfw.GLFW;
137
import net.notcoded.wayfix.WayFix;
148

9+
import org.spongepowered.asm.mixin.Dynamic;
1510
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.Unique;
1612
import org.spongepowered.asm.mixin.injection.At;
1713
import org.spongepowered.asm.mixin.injection.Inject;
1814
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -26,25 +22,20 @@
2622
@Mixin(Keyboard.class)
2723
public class KeyboardMixin {
2824

29-
@Inject(method = "onChar", at = @At("HEAD"), cancellable = true)
30-
//? if <1.21.9 {
31-
private void charTyped(long window, int codePoint, int modifiers, CallbackInfo ci) {
32-
//?}
33-
//? if >=1.21.9 {
34-
/*private void charTyped(long window, CharInput input, CallbackInfo ci) {
35-
*///?}
25+
@Unique
26+
private static final int LEFT_CTRL = PlatformDependent.isOsx() ? GLFW.GLFW_KEY_LEFT_SUPER : GLFW.GLFW_KEY_LEFT_CONTROL;
27+
@Unique
28+
private static final int RIGHT_CTRL = PlatformDependent.isOsx() ? GLFW.GLFW_KEY_RIGHT_SUPER : GLFW.GLFW_KEY_RIGHT_CONTROL;
29+
30+
@Dynamic
31+
@Inject(method = {"onChar", "method_1457"}, at = @At("HEAD"), cancellable = true, require = 1)
32+
private void charTyped(CallbackInfo ci) {
3633
if(!WayFix.config.keyModifiersFix || !WayFix.isWayland()) return;
3734

38-
//? if >=1.21.9 {
39-
/*if(GLFW.glfwGetKey(window, SystemKeycodes.LEFT_CTRL) == GLFW.GLFW_PRESS ||
40-
GLFW.glfwGetKey(window, SystemKeycodes.RIGHT_CTRL) == GLFW.GLFW_PRESS ||
35+
long window = MinecraftClient.getInstance().getWindow().getHandle();
36+
if(GLFW.glfwGetKey(window, LEFT_CTRL) == GLFW.GLFW_PRESS ||
37+
GLFW.glfwGetKey(window, RIGHT_CTRL) == GLFW.GLFW_PRESS ||
4138
GLFW.glfwGetKey(window, GLFW.GLFW_KEY_LEFT_ALT) == GLFW.GLFW_PRESS
42-
*///?}
43-
//? if <1.21.9 {
44-
if(
45-
Screen.hasControlDown() ||
46-
InputUtil.isKeyPressed(window, GLFW.GLFW_KEY_LEFT_ALT)
47-
//?}
4839
) {
4940
ci.cancel();
5041
}

stonecutter.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id("dev.kikugie.stonecutter")
3-
id("dev.architectury.loom") version "1.13.457" apply false
4-
id("architectury-plugin") version "3.4.162" apply false
3+
id("dev.architectury.loom") version "1.13.465" apply false
4+
id("architectury-plugin") version "3.4-SNAPSHOT" apply false
55
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
66
id("me.modmuss50.mod-publish-plugin") version "1.1.0" apply false
77
}

versions/1.20.6-fabric/gradle.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
mod.mc_dep=>=1.20- <=1.21.8
2-
mod.version_name=1.20-1.21.8
3-
mod.mc_targets=1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8
1+
mod.mc_dep=>=1.20- <26.1
2+
# https://www.minecraft.net/en-us/article/minecraft-new-version-numbering-system
3+
mod.version_name=1.20
4+
mod.mc_targets=1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8,1.21.9,1.21.10,1.21.11
45

56
deps.yarn_build=1
67

versions/1.20.6-forge/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
mod.mc_dep=[1.20.5, 1.21.8]
1+
mod.mc_dep=[1.20.5,)
22
mod.version_name=1.20.5
3-
mod.mc_targets=1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8
3+
mod.mc_targets=1.20.5,1.20.6,1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8,1.21.9,1.21.10,1.21.11
44

55
deps.yarn_build=1
66
deps.forge_loader=50.1.0

versions/1.21-neoforge/gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
mod.mc_dep=[1.21, 1.21.8]
2-
mod.version_name=1.21-1.21.8
3-
mod.mc_targets=1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8
1+
mod.mc_dep=[1.21,)
2+
mod.version_name=1.21
3+
mod.mc_targets=1.21,1.21.1,1.21.2,1.21.3,1.21.4,1.21.5,1.21.6,1.21.7,1.21.8,1.21.9,1.21.10,1.21.11
44

55
deps.yarn_build=9
66
deps.neoforge_loader=21.0.167

versions/1.21.9-fabric/gradle.properties

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mod.mc_dep=[1.21.9,)
2+
mod.version_name=1.21.9
3+
mod.mc_targets=1.21.9,1.21.10,1.21.11
4+
5+
deps.yarn_build=1
6+
deps.neoforge_loader=21.9.16-beta
7+
deps.neoforge_patch=1.21+build.4
8+
9+
deps.cloth_config_version=20.0.149
10+
11+
deps.java=21
12+
13+
loom.platform=neoforge

0 commit comments

Comments
 (0)