Skip to content

Commit 3a7e30b

Browse files
committed
Patch latest Meteor Client and 1.21.11 compatibility.
1 parent 8f9d547 commit 3a7e30b

File tree

7 files changed

+34
-18
lines changed

7 files changed

+34
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
适配已更新至 1.21.9+ 的已兼容模组
2-
剩余未更新的模组列表:
3-
- EMI
4-
- FTB Library
5-
- BlockUI
6-
- SuperMartijn642's Core Lib
1+
修补新版 Meteor Client 以及 NeoForge 1.21.11 的兼容问题
72

83
[历史更新日志](https://github.com/reserveword/IMBlocker/blob/1.21.9%2B/Changelog_History.md)

Changelog_History.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 6.0.2
2+
- 修补新版 Meteor Client 以及 NeoForge 1.21.11 的兼容问题
3+
4+
<br>
5+
16
# 6.0.1
27
- 适配已更新至 1.21.9+ 的已兼容模组
38

common/src/main/java/io/github/reserveword/imblocker/common/IMBlockerKeyBindings.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010

1111
public final class IMBlockerKeyBindings {
1212
public static final KeyMapping unlockIMEKey = new KeyMapping(
13-
"key.unlockIME", Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_SHIFT,
14-
Category.register(ResourceLocation.fromNamespaceAndPath("imblocker", "ime")));
13+
"key.unlockIME", Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_SHIFT, createCategory());
14+
15+
private static Category createCategory() {
16+
try {
17+
return Category.register(ResourceLocation.fromNamespaceAndPath("imblocker", "ime"));
18+
} catch (Throwable e) {
19+
try {
20+
//1.21.11+ unobf.
21+
Class<?> resourceCls = Class.forName("net.minecraft.resources.Identifier");
22+
return ReflectionUtil.invokeMethod(Category.class, null, Category.class, "register",
23+
new Class[] {resourceCls},
24+
ReflectionUtil.invokeMethod(resourceCls, null, resourceCls, "fromNamespaceAndPath",
25+
new Class[] {String.class, String.class}, "imblocker", "ime"));
26+
} catch (Throwable e2) {
27+
throw new RuntimeException();
28+
}
29+
}
30+
}
1531
}

common/src/main/java/io/github/reserveword/imblocker/mixin/compat/MeteorTextFieldMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ public abstract class MeteorTextFieldMixin extends MeteorWidgetMixin {
2121
@Shadow protected int cursor;
2222
@Shadow protected double textStart;
2323

24-
@Shadow
25-
protected boolean focused;
24+
private boolean imblocker$focused; //unaffected by internal changes
2625

2726
@Shadow
2827
protected abstract double getTextWidth(int pos);
2928

3029
@Inject(method = "setFocused", at = @At("TAIL"))
3130
public void focusChanged(boolean isFocused, CallbackInfo ci) {
32-
imblocker$onFocusChanged(focused);
31+
imblocker$focused = isFocused;
32+
imblocker$onFocusChanged(isFocused);
3333
}
3434

3535
@Inject(method = "onCharTyped", at = @At("HEAD"), cancellable = true)
3636
public void checkFocusTracking(CharacterEvent input, CallbackInfoReturnable<Boolean> cir) {
3737
if(FocusManager.isTrackingFocus) {
38-
if(focused) {
38+
if(imblocker$focused) {
3939
FocusContainer.MINECRAFT.switchFocus(this);
4040
cir.setReturnValue(true);
4141
}else {

fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ java {
4242

4343
project.jar {
4444
from("LICENSE") {
45-
rename { "${it}_${project.base.archivesName.get()}"}
45+
rename { "${it}_${project.base.archivesName.get()}" }
4646
}
4747
from project(":common").sourceSets.main.output
4848
from sourceSets.main.output

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ fabric_loader_version=0.17.2
1010
fabric_version=0.134.0+1.21.9
1111

1212
# NeoForge
13-
neo_version=21.9.11-beta
14-
parchment_minecraft_version=1.21.8
15-
parchment_mappings_version=2025.09.14
13+
neo_version=21.9.16-beta
14+
neogradle.subsystems.parchment.minecraftVersion=1.21.9
15+
neogradle.subsystems.parchment.mappingsVersion=2025.10.05
1616

1717
# Mod
1818
mod_id=imblocker
1919
mod_name=IMBlocker
20-
mod_version=6.0.1
20+
mod_version=6.0.2
2121
mod_logo=imblocker.png
2222
mod_description=Blocks Input Methods when you're not using it.\\n在你不打字的时候自动关闭输入法
2323
mod_url=https://github.com/reserveword/IMBlocker

neoforge/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'eclipse'
33
id 'java'
4-
id 'net.neoforged.gradle.userdev' version '7.0.192'
4+
id 'net.neoforged.gradle.userdev' version '7.1.11'
55
}
66

77
base {

0 commit comments

Comments
 (0)