
Modern KeyBinding
Port KeyModifier && KeyConflictContext back to Fabric & Early Forge
Автор: TachibanaSherry669,7 тыс.132обновлён 12 янв. 2024 г.
БиблиотекиУтилиты
Описание
Modern KeyBinding
The mod ported the newer version's KeyModifier && KeyConflictContext back to Fabric & Early Forge.
Features
You can now define a keybinding's activation key with key modifiers. Like "Ctrl + G" or "Alt + S";
The keybindings with the same activation key but different key conflict contexts no longer conflict.
"Non-conflict keys" (disabled by default): The keybindings with the same key will all be activated if the key is pressed.
Attention:
The mod will crash with NEI. Use NEI Unofficial(Dependencies: CodeChickenCore | CodeChickenLib) by GTNH instead.
Import as a Gradle dependency
repositories {
//...
maven {
url "https://maven.nova-committee.cn/releases"
}
}
dependencies {
//...
// Forge
implementation "committee.nova.mkb.forge:mkb-${mc_version}:${mod_version}"
// Fabric
modImplementation "committee.nova.mkb.fabric:mkb-${mc_version}:${mod_version}"
}
Register a keybinding
Register a keybinding that:
-
Activates when Alt and C are pressed;
-
Only available in GUI.
ClientProxy.java
public class ClientProxy {
public void init(final FMLInitializationEvent event) {
//...
yourKeyBinding = KeyBindingRegistry.INSTANCE.registerKeyBinding("key.exampleKey", KeyConflictContext.GUI, KeyModifier.ALT, Keyboard.KEY_C, "key.categories.example");
}
}
Change the properties of an existing keybinding
ClientProxy.java
public class ClientProxy {
//...
public void postInit(final FMLPostInitializationEvent event) {
final IKeyBinding extended = (IKeyBinding) yourKeyBinding;
// Change the key's keyCode and modifier, as their default values.
extended.setInitialKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);
// Change the key's keyCode and modifier.
extended.setKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);
// Change the key's conflict context.
extended.setKeyConflictContext(KeyConflictContext.IN_GAME);
}
}
Последние версии
Все версии →release
Fabric-1.20.4-1.3.0
1.20.4-1.3.012 янв. 2024 г.8,9 тыс.Minecraft: 1.20.4fabric
release
Fabric-1.20.X-1.2.0
1.20.X-1.2.016 июл. 2023 г.260,9 тыс.Minecraft: 1.20, 1.20.1fabric
Что нового
Support Controlling-Fabric-1.20.1-12.0.2+
release
Fabric-1.20-1.1.0
1.20-1.1.09 июн. 2023 г.2,4 тыс.Minecraft: 1.20fabric
release
Fabric-1.19.4-1.1.0
1.19.4-1.1.02 июн. 2023 г.3,4 тыс.Minecraft: 1.19.4fabric
release
Fabric-1.19.2-1.1.0
1.19.2-1.1.02 июн. 2023 г.12 тыс.Minecraft: 1.19.2fabric
release
Fabric-1.18.2-1.1.0
1.18.2-1.1.02 июн. 2023 г.1,3 тыс.Minecraft: 1.18.2fabric
release
Fabric-1.16.5-1.1.0
1.16.5-1.1.02 июн. 2023 г.20,8 тыс.Minecraft: 1.16.5fabric
release
Fabric-1.19.4-1.0.0
1.19.4-1.0.023 мая 2023 г.581Minecraft: 1.19.4fabric
release
Fabric-1.19.2-1.0.0
1.19.2-1.0.023 мая 2023 г.258Minecraft: 1.19.2fabric
release
Fabric-1.18.2-1.0.0
1.18.2-1.0.023 мая 2023 г.184Minecraft: 1.18.2fabric