Skip to content

Commit 7885510

Browse files
committed
Fix bindings overriding each other
1 parent 9d8c7ac commit 7885510

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ yarn_mappings=1.21.6+build.1
88
loader_version=0.16.14
99

1010
# Fabric API
11-
fabric_version=0.127.0+1.21.6
11+
fabric_version=0.127.1+1.21.6
1212
loom_version=1.10-SNAPSHOT
1313

1414
# Mod Properties
15-
mod_version=1.7.0-rc.1
15+
mod_version=1.7.1
1616
maven_group=net.immortaldevs
1717
archives_base_name=fabric-bind-cmd
1818

1919
# Kotlin
2020
kotlin_version=2.1.21
2121
fabric_kotlin_version=1.13.3+kotlin.2.1.21
22-
modmenu_version=15.0.0-beta.1
22+
modmenu_version=15.0.0-beta.2

src/main/kotlin/net/immortaldevs/bindcmd/CommandBinding.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class CommandBinding(var command: String, var key: KeyBinding) {
3838
}
3939

4040
fun unbind() {
41-
this.key.setBoundKey(InputUtil.UNKNOWN_KEY)
41+
KeyBinding.KEYS_BY_ID.remove(this.key.translationKey)
42+
KeyBinding.updateKeysByCode()
4243
}
4344
}

src/main/kotlin/net/immortaldevs/bindcmd/config/Config.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ class Config {
1212
ConfigLoader(MinecraftClient.getInstance().runDirectory)
1313
}
1414
private var serverBindings = listOf<CommandBinding>()
15-
private var clientBindings = mutableListOf(
16-
CommandBinding("/help", InputUtil.GLFW_KEY_H),
17-
)
15+
private var clientBindings = mutableListOf<CommandBinding>()
1816

1917
val bindings: List<CommandBinding>
2018
get() = clientBindings + serverBindings
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
accessWidener v2 named
2-
accessible field net/minecraft/server/MinecraftServer session Lnet/minecraft/world/level/storage/LevelStorage$Session;
2+
accessible field net/minecraft/server/MinecraftServer session Lnet/minecraft/world/level/storage/LevelStorage$Session;
3+
accessible field net/minecraft/client/option/KeyBinding KEYS_BY_ID Ljava/util/Map;

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"fabric-api": "*",
4242
"fabric-language-kotlin": "*",
4343
"fabricloader": ">=0.16.0",
44-
"minecraft": ">=1.21.6 <1.22",
44+
"minecraft": "1.21.6",
4545
"modmenu": "*"
4646
}
4747
}

0 commit comments

Comments
 (0)