物品分解
分解站与合成工作站完全独立:两者 ID 互不关联,分别在各自目录加载。分解不是工作站的第四页。
/emakistation dismantle <工作站>需要 emakistation.dismantle,以及该分解站的访问权限(配置留空时回落到 emakistation.dismantle.access.<id>)。
玩家把符合 input_source 的物品放入分解槽,点击确认后按 rolls 次从 pool 中随机抽取产物。
分解站定义
放在 plugins/EmakiStation/stations_dismantle/ 下,文件名与 id 一致。
id: "example_dismantle"
display_name: "<aqua>示例分解台</aqua>"
layout: "station_dismantle"
permission: ""
output:
default: "storage_first"
condition:
invalid_as_failure: true
entries: []| 字段 | 说明 |
|---|---|
id | 分解站 id,与文件名一致。 |
display_name | 界面标题使用的显示名。 |
layout | 界面布局,指向 gui/<名字>.yml。省略时自动使用 station_dismantle。 |
permission | 打开该分解站需要的权限。留空则回落到 emakistation.dismantle.access.<id>。 |
output.default | 产物去向,取值与合成工作站一致。 |
condition | 打开界面前的条件门。 |
分解站没有 queue 段、没有 channels 段、没有 preview_layout / queue_layout,也没有 output.player_switchable。分解是即时结算的,不进队列。
所有目标都放不下时,分解产物进入「待领取」状态,不会掉落也不会销毁。
分解配方定义
放在 plugins/EmakiStation/recipes_dismantle/ 下。一个文件一条配方,文件名不影响加载,配方 ID 由文件内的 id 字段决定。
id: "example_dismantle"
display_name: "<yellow>铁块分解示例</yellow>"
station_id: ""
tags:
- "blacksmith"
permission: ""
input_source: "minecraft-iron_block"
rolls:
min: 2
max: 3
pool:
- item_source: "minecraft-iron_ingot"
amount:
min: 2
max: 4
weight: 6.0
- item_source: "minecraft-nugget"
amount: 3
weight: 3.0
condition:
invalid_as_failure: true
entries: []| 字段 | 说明 |
|---|---|
id | 配方 id。 |
display_name | 显示名。 |
station_id | 绑定的分解站,单数。 |
tags | 标签,用于让分解站按标签引用。 |
permission | 使用该配方需要的权限,留空表示不限制。 |
input_source | 输入物品,放入分解格的物品必须匹配此来源。格式与普通配方的 item source 一致。 |
matcher | 可选。顶层通用物品匹配器,按组件、PDC、Lore 等条件判定输入。与 input_source 取且关系,两者都成立才命中,见下方的注意事项。见 物品匹配器。 |
rolls | 每次分解的投掷次数。 |
pool | 产物概率池。 |
condition | 提交前的条件门,与普通配方一致。不满足时分解按钮被拒绝。 |
用 matcher 判定输入
顶层 matcher 让分解配方能按物品数据挑输入,例如只分解已经摔过的装备:
id: "damaged_gear_dismantle"
# input_source 仍必填,且与 matcher 一起参与判定
input_source: "minecraft-iron_chestplate"
matcher:
type: component
component: damage
operator: '>'
value: 0
rolls: 1
pool:
- item_source: "minecraft-iron_nugget"
amount: 2
weight: 1.0matcher 与 input_source 取「且」关系
input_source 与 matcher 是且的关系:input_source 必须匹配,matcher(若写了)再追加判定,两者都成立才可分解。input_source 始终必填。上例只分解「铁胸甲且摔过」的物品。
也就是说,「某种物品 且 满足组件条件」可以直接表达:物品源写在 input_source,组件条件写在 matcher。
matcher 内部仍然不能补物品源条件(type: item_source / item_sources / source / sources 会被拒绝并告警,该 matcher 恒不匹配)。物品源只写在顶层 input_source。
NOTE
分解侧没有合成侧的栈模型限制。合成配方写 matcher 会让整条配方只从背包扣料,分解配方一向只看玩家背包里的实际物品,不受这个约束。
完整语法见 物品匹配器。
rolls 投掷次数
两种写法:
# 固定次数
rolls: 3# 范围(含两端)
rolls:
min: 2
max: 4pool 产物概率池
每次投掷从池中随机选一项。
| 字段 | 说明 |
|---|---|
item_source | 产物来源,单数,一项一个来源。 |
amount | 数量,支持固定值或 min / max 范围。 |
weight | 相对权重,默认 1.0,必须大于 0。 |
与合成配方的差异
| 维度 | 合成配方 | 分解配方 |
|---|---|---|
| 工作站绑定 | station_ids(复数列表) | station_id(单数)或 tags |
| 输入 | materials(多条需求,每条一个 item_sources 集合) | input_source(单个来源) |
| 产出 | result.outputs 固定清单 | pool 按 weight 随机抽取 |
| 耗时 | duration_seconds,进队列 | 无耗时,即时结算 |
| 货币成本 | cost | 无 |
| 条件门 | condition + display_condition | 仅 condition |
| 阶段动作 | actions.pre / success / failure | 无 |