Skip to content

物品分解

分解站与合成工作站完全独立:两者 ID 互不关联,分别在各自目录加载。分解不是工作站的第四页。

text
/emakistation dismantle <工作站>

需要 emakistation.dismantle,以及该分解站的访问权限(配置留空时回落到 emakistation.dismantle.access.<id>)。

玩家把符合 input_source 的物品放入分解槽,点击确认后按 rolls 次从 pool 中随机抽取产物。

分解站定义

放在 plugins/EmakiStation/stations_dismantle/ 下,文件名与 id 一致。

yaml
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 字段决定。

yaml
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 让分解配方能按物品数据挑输入,例如只分解已经摔过的装备:

yaml
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.0

matcher 与 input_source 取「且」关系

input_sourcematcher的关系:input_source 必须匹配,matcher(若写了)再追加判定,两者都成立才可分解。input_source 始终必填。上例只分解「铁胸甲摔过」的物品。

也就是说,「某种物品 且 满足组件条件」可以直接表达:物品源写在 input_source,组件条件写在 matcher

matcher 内部仍然不能补物品源条件(type: item_source / item_sources / source / sources 会被拒绝并告警,该 matcher 恒不匹配)。物品源只写在顶层 input_source

NOTE

分解侧没有合成侧的栈模型限制。合成配方写 matcher 会让整条配方只从背包扣料,分解配方一向只看玩家背包里的实际物品,不受这个约束。

完整语法见 物品匹配器

rolls 投掷次数

两种写法:

yaml
# 固定次数
rolls: 3
yaml
# 范围(含两端)
rolls:
  min: 2
  max: 4

pool 产物概率池

每次投掷从池中随机选一项。

字段说明
item_source产物来源,单数,一项一个来源。
amount数量,支持固定值或 min / max 范围。
weight相对权重,默认 1.0,必须大于 0。

与合成配方的差异

维度合成配方分解配方
工作站绑定station_ids(复数列表)station_id(单数)或 tags
输入materials(多条需求,每条一个 item_sources 集合)input_source(单个来源)
产出result.outputs 固定清单poolweight 随机抽取
耗时duration_seconds,进队列无耗时,即时结算
货币成本cost
条件门condition + display_conditioncondition
阶段动作actions.pre / success / failure