跳到主要内容

GUI

修复 GUI 配置文件:

plugins/MMOItemsRepair/menu.yml

布局

title: "&8&lMMOItems Repair Station"
size: 54
target-slot: 13
material-slots:
- 29
- 30
- 31
- 32
- 33
confirm-slot: 22
info-slot: 40
close-slot: 49

size 必须是 9 到 54 之间的背包大小。如果值不是 9 的倍数,插件会自动规范化。

槽位编号从 0 开始。

target-slot 是待修复物品槽位。

material-slots 是修复材料槽位。

confirm-slot 是修复确认按钮。

info-slot 是说明按钮。

close-slot 是关闭按钮。

填充物品

filler:
enabled: true
exclude-slots: []

启用 filler 后,未使用的 GUI 槽位会填充为配置的填充按钮物品。

如果希望某些槽位保持为空,可以使用 exclude-slots

按钮

按钮配置位于:

buttons:

每个按钮支持:

material: ANVIL
name: "&6&lPerform Repair"
lore:
- "&7Current Status: {status}"
custom-model-data: 10002
item-model: "yourpack:gui/confirm_ready"

material 使用 Bukkit 材质名。

custom-model-data 是可选项。

item-model 是可选项,接受类似 namespace:path 的 namespaced key。

确认按钮状态

buttons:
confirm:
status:
no-target: "&7Please insert an item to repair"
invalid-target: "&cThis item cannot be repaired"
unsupported-target: "&cNo matching repair configuration found"
fully-repaired: "&aThis item is already at full durability"
missing-materials: "&eInsufficient materials"
ready: "&aReady for repair"

这些消息会用于确认按钮 lore。

材料显示行

buttons:
confirm:
ingredients:
title: "&7Required Materials:"
ok: "&a[OK] &f{ingredient} &7x{required} &8({current}/{required})"
missing: "&c[X] &f{ingredient} &7x{required} &8({current}/{required})"

可用占位符:

{ingredient}
{required}
{current}

常用占位符

按钮 lore 可根据上下文使用这些占位符:

{status}
{repair}
{current}
{max}
{item}
{recipe}

背包移动

玩家打开修复 GUI 时仍可以移动自己背包里的物品。插件只会限制会破坏修复 GUI 输入槽或操作槽的交互。

目标槽只接受一个待修复物品,避免整组装备被放入修复目标槽。