Skip to content

Commit f43d591

Browse files
committed
build: 1.21.9-rc1
1 parent 1f85923 commit f43d591

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
matrix:
1313
# Use these Java versions
1414
java: [
15-
17, # Current Java LTS & minimum supported by Minecraft
15+
21, # Current Java LTS & minimum supported by Minecraft
1616
]
1717
# and run on Linux
18-
os: [ubuntu-20.04]
18+
os: [ubuntu-24.04]
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- name: checkout repository
@@ -32,7 +32,7 @@ jobs:
3232
- name: build
3333
run: ./gradlew build
3434
- name: capture build artifacts
35-
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
35+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
3636
uses: actions/upload-artifact@v2
3737
with:
3838
name: Artifacts

build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
plugins {
2-
id 'fabric-loom' version '1.4-SNAPSHOT'
2+
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
44
}
55

6-
sourceCompatibility = JavaVersion.VERSION_17
7-
targetCompatibility = JavaVersion.VERSION_17
6+
java {
7+
sourceCompatibility = JavaVersion.VERSION_17
8+
targetCompatibility = JavaVersion.VERSION_17
9+
}
10+
11+
base {
12+
archivesName = project.archives_base_name
13+
}
814

9-
archivesBaseName = project.archives_base_name
1015
version = project.mod_version
1116
group = project.maven_group
1217

@@ -55,7 +60,7 @@ java {
5560

5661
jar {
5762
from("LICENSE") {
58-
rename { "${it}_${project.archivesBaseName}"}
63+
rename { "${it}_${project.archives_base_name}"}
5964
}
6065
}
6166

gradle.properties

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.20.4
7-
yarn_mappings=1.20.4+build.3
8-
loader_version=0.15.3
6+
minecraft_version=1.21.9-rc1
7+
yarn_mappings=1.21.9-rc1+build.1
8+
loader_version=0.17.2
99

1010
# Mod Properties
1111
mod_version = 1.0.1
1212
maven_group = com.ishland.fabric
1313
archives_base_name = fix-keyboard-on-linux
1414

15-
# Dependencies
16-
fabric_version=0.55.1+1.19
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/com/ishland/fixkeyboardonlinux/TheMod.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
package com.ishland.fixkeyboardonlinux;
22

3+
import io.netty.util.internal.PlatformDependent;
34
import net.fabricmc.api.ModInitializer;
5+
import org.lwjgl.glfw.GLFW;
46

57
public class TheMod implements ModInitializer {
8+
9+
public static final int KEY_LEFT_CTRL = PlatformDependent.isOsx() ? GLFW.GLFW_KEY_LEFT_SUPER : GLFW.GLFW_KEY_LEFT_CONTROL;
10+
public static final int KEY_RIGHT_CTRL = PlatformDependent.isOsx() ? GLFW.GLFW_KEY_RIGHT_SUPER : GLFW.GLFW_KEY_RIGHT_CONTROL;
11+
612
@Override
713
public void onInitialize() {
814

src/main/java/com/ishland/fixkeyboardonlinux/mixin/MixinKeyboard.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ishland.fixkeyboardonlinux.mixin;
22

3+
import com.ishland.fixkeyboardonlinux.TheMod;
34
import net.minecraft.client.Keyboard;
45
import net.minecraft.client.MinecraftClient;
56
import net.minecraft.client.gui.screen.Screen;
@@ -15,7 +16,13 @@ public class MixinKeyboard {
1516

1617
@Inject(method = "onChar", at = @At(value = "HEAD"), cancellable = true)
1718
private void beforeOnChar(CallbackInfo ci) {
18-
if (Screen.hasControlDown() || InputUtil.isKeyPressed(MinecraftClient.getInstance().getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_ALT)) ci.cancel();
19+
long handle = MinecraftClient.getInstance().getWindow().getHandle();
20+
21+
if (GLFW.glfwGetKey(handle, TheMod.KEY_LEFT_CTRL) == GLFW.GLFW_PRESS ||
22+
GLFW.glfwGetKey(handle, TheMod.KEY_RIGHT_CTRL) == GLFW.GLFW_PRESS ||
23+
GLFW.glfwGetKey(handle, GLFW.GLFW_KEY_LEFT_ALT) == GLFW.GLFW_PRESS) {
24+
ci.cancel();
25+
}
1926
}
2027

2128
}

0 commit comments

Comments
 (0)