Modern KeyBinding
本模组将较新版本中的 KeyModifier 和 KeyConflictContext 功能移植回了 Fabric 和早期版本的 Forge。
特性
你现在可以使用按键修饰符来定义键绑定的激活键。例如 “Ctrl + G” 或 “Alt + S”;
具有相同激活键但不同冲突上下文的键绑定不再发生冲突。
“非冲突键”(默认禁用):如果按下相同的键,所有相关的键绑定都会被激活。
注意:
该模组与 NEI 不兼容会导致崩溃。请改用 GTNH 提供的 NEI Unofficial(依赖项:CodeChickenCore | CodeChickenLib)。
作为 Gradle 依赖导入
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}"
}
注册一个键绑定
注册一个满足以下条件的键绑定:
-
当同时按下 Alt 和 C 时激活;
-
仅在 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");
}
}
更改现有键绑定的属性
ClientProxy.java
public class ClientProxy {
//...
public void postInit(final FMLPostInitializationEvent event) {
final IKeyBinding extended = (IKeyBinding) yourKeyBinding;
// 更改键的 keyCode 和修饰符,使用其默认值。
extended.setInitialKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);
// 更改键的 keyCode 和修饰符。
extended.setKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);
// 更改键的冲突上下文。
extended.setKeyConflictContext(KeyConflictContext.IN_GAME);
}
}
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);
}
}
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
下载 Modern KeyBinding
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧