排序按键

[!INFO] 注册真源:client/keybinds/control/BSKeybinds.java:43

Inventory Bogo Sorter 的核心交互是按键组合。它有两套并存的控制层:7 个 Minecraft 原生 KeyBinding(可在选项→控制中改键),以及在其之上由 KeyBind 类构建的多键组合按键(GUI 内专用,构造见 client/keybinds/KeyBind.java)。

原生 KeyBinding(7 个)

字段 说明
sortKeyInGUI 在容器 GUI 内触发整理
sortKeyOutsideGUI 在 GUI 之外触发整理
configGuiKey 打开本模组配置界面(common/config/ConfigGui.java)
dropoffKey 打开投放到掉落方块的管理界面(common/dropoff/DropOffHandler)
ae2TerminalSearchKey 在 AE2 终端中唤起本模组的搜索适配器(compat/ae2/Ae2TerminalSearchAdapter)
pinSlotKey 固定/取消固定当前槽位(common/PinnedSlots.java)
BOGO_SORTER_CONTROLS_BUTTON 注入控制列表中的自定义条目(client/keybinds/gui/BSGuiKeybindList)

多键组合 KeyBind

BSKeybinds.java:147 从配置项构建 KeyBind:每个 KeyBind 由一组必须按下的键、一组必须松开的键和一个额外 BooleanSupplier 判定器构成,并记录 pressedTick 以区分「首次按下」与「长按 N tick」。

KeyBind 暴露的判定接口:isPressed()、areKeysHeld()(忽略事件判定器与 tick 记账的原始按键状态)、getTicksPressed()、isFirstPress()、isFirstPressOrHeldLong(int)。

相关功能

  • 固定槽位:pinSlotKey 写入 PinnedSlots,整理时固定槽位不参与重排(服务端通过 SPlayerPins 同步)
  • 热键栏交换:common/HotbarSwap.java + CHotbarSwap,由配置 enableHotbarSwap 控制
  • 自动补充:common/refill/RefillHandler.java,按键触发回补;autoRefillDamageThreshold 控制触发阈值

关联:物品排序规则 · 配置项