Skip to content

EmakiCooking 总览

EmakiCooking 是一套世界工位烹饪系统。玩家在世界中与砧板、炒锅、研磨机、蒸锅四种工位方块交互,完成各种烹饪操作。同时支持从旧版 JiuWu's Kitchen 一键迁移配置。

基本信息

属性
版本2.2.0
artifactIdemaki-cooking
主类emaki.jiuwu.craft.cooking.EmakiCookingPlugin
根命令/ecooking
别名/ec
强依赖EmakiCoreLib
软依赖CraftEngine, ItemsAdder, Nexo

信息

EmakiCooking 是 Emaki 系列中唯一不软依赖 EmakiAttribute 的功能模块——它只关心世界工位交互,不涉及装备属性成长。

它做了什么

从整体来看,EmakiCooking 的工作可以拆成几个层面:

  • 管理砧板、炒锅、研磨机、蒸锅四种工位的交互逻辑和运行时状态
  • StationStateStore 把每个工位的状态按世界坐标持久化到 data/stations/ 目录下的 YAML 文件里,服务器重启不会丢失进度
  • CookingBlockMatcher 判断世界中的方块是不是某个工位——支持原版方块,也支持 CraftEngine、ItemsAdder、Nexo 自定义方块
  • CookingRewardService 处理烹饪结果的发放,可以掉落到世界、直接给背包,或者触发一串动作
  • LegacyImportService 从旧版 JiuWu's Kitchen 迁移数据,CookingInspectService 则用于排查物品来源
  • CookingLayerSnapshotBuilder 为产出物品构建装配层快照,和 CoreLib 的装配系统对接

config.yml 完整格式

yaml
# 配置文件版本,请勿手动修改
config_version: "2.2.0"

# 语言文件标识
language: zh_CN

# 是否在首次启动时释放默认资源(配方、GUI、语言文件等)
release_default_data: true

# 旧版导入设置
legacy_import:
  # 旧版 JiuWu's Kitchen 数据目录名称
  old_directory: "old"

# ============================================================
# 展示调整 (Display Adjustments)
# 控制工位上方 ItemDisplay 实体的偏移、旋转与缩放
# ============================================================
display_adjustments:
  # 全局默认值 —— 所有工位未单独配置时使用
  defaults:
    # 物品展示(非方块类物品)
    item:
      offset:
        x: 0.5
        y: 1.02
        z: 0.5
      rotation:
        x: 90       # 固定角度,或 "min-max" 范围随机
        y: 0
        z: 0
      scale:
        x: 0.5
        y: 0.5
        z: 0.5
    # 方块展示(方块类物品)
    block:
      offset:
        x: 0.5
        y: 1.125
        z: 0.5
      rotation:
        x: 0
        y: 90
        z: 0
      scale:
        x: 0.25
        y: 0.25
        z: 0.25

  # 工位级默认值 —— 覆盖全局默认
  station_defaults:
    wok:
      item:
        offset:
          y: 1.05
        rotation:
          y: "0-360"   # 随机旋转范围

# ============================================================
# 工位配置 (Stations)
# ============================================================
stations:

  # ---- 砧板 (Chopping Board) ----
  chopping_board:
    # 工位方块来源(vanilla 或 craftengine 格式)
    block_source: "minecraft-oak_slab"
    # 是否需要潜行才能交互
    require_sneaking: true
    # 结果是否掉落到世界(false 则直接给予背包)
    drop_result: true
    # 是否检查砧板上方空间(上方必须为空气)
    space_restriction: false
    # 两次交互之间的最小间隔(毫秒)
    interaction_delay_ms: 1000
    # 允许作为切割工具的物品来源列表
    tool_sources:
      - "minecraft-iron_sword"
      - "minecraft-diamond_sword"
      - "minecraft-netherite_sword"
    # 切割时对玩家造成伤害的配置
    cut_damage:
      enabled: true
      chance: 10       # 百分比概率 (0-100)
      value: 2         # 伤害值

  # ---- 炒锅 (Wok) ----
  wok:
    block_source: "minecraft-cauldron"
    require_sneaking: true
    drop_result: true
    # 出锅时是否需要碗
    need_bowl: true
    # 两次翻炒之间的最小间隔(毫秒)
    stir_delay_ms: 5000
    # 超时时间(毫秒),超过此时间未翻炒视为烧焦
    timeout_ms: 30000
    # 无匹配配方时的默认产出物品来源
    invalid_result_source: ""
    # 允许作为锅铲的物品来源列表
    spatula_sources:
      - "minecraft-wooden_shovel"
      - "minecraft-stone_shovel"
    # 火力等级规则 —— 炒锅下方方块决定火力
    heat_levels:
      - source: "minecraft-campfire"
        level: 1
      - source: "minecraft-soul_campfire"
        level: 2
    # 空手取食材时的烫伤伤害
    scald_damage:
      enabled: true
      value: 2
    # 随机失败配置
    failure:
      enabled: true
      chance: 5        # 百分比概率
      output_source: "minecraft-charcoal"

  # ---- 研磨机 (Grinder) ----
  grinder:
    block_source: "minecraft-lodestone"
    require_sneaking: true
    drop_result: true
    # 后台检查间隔(tick,20 tick = 1 秒)
    check_delay_ticks: 20

  # ---- 蒸锅 (Steamer) ----
  steamer:
    block_source: "minecraft-barrel"
    require_sneaking: true
    drop_result: true
    # 热源方块列表(蒸锅下方方块)
    heat_sources:
      - "minecraft-campfire"
      - "minecraft-soul_campfire"
    # 添加燃料时是否自动点燃热源
    ignite_heat_source: true
    # 燃料规则 —— 物品来源 → 燃烧时长(秒)
    fuels:
      - source: "minecraft-coal"
        duration_seconds: 60
      - source: "minecraft-charcoal"
        duration_seconds: 40
    # 水分来源规则 —— 输入物品 → 输出物品 + 水分值
    moisture_sources:
      - input_source: "minecraft-water_bucket"
        output_source: "minecraft-bucket"
        moisture: 100
    # 蒸汽耗尽时是否重置烹饪进度
    reset_progress_when_steam_empty: true
    # 每 tick 从水分转化为蒸汽的量
    steam_production_efficiency: 10
    # 每 tick 每个食材消耗的蒸汽量
    steam_conversion_efficiency: 1
    # 每 tick 基础蒸汽消耗量
    steam_consumption_efficiency: 1

默认内容

内容类型数量说明
烹饪配方4cut_carrotbone_mealsimple_stewsteamed_cod

默认资源目录

文件/目录说明
config.yml主配置
recipes/chopping_board/砧板配方
recipes/wok/炒锅配方
recipes/grinder/研磨机配方
recipes/steamer/蒸锅配方
gui/steamer.yml蒸锅 GUI 配置
item_adjustments/物品展示调整配置
lang/语言文件
data/stations/运行时工位状态
old/旧版数据目录
backup/导入备份目录

item_adjustments 格式

有时候默认的展示效果不太理想——比如某个 CraftEngine 自定义食材在砧板上显示得太大或位置偏了。这时可以在 item_adjustments/ 目录下为特定物品来源创建展示覆盖文件:

yaml
# item_adjustments/craftengine-custom_food.yml
source: "craftengine-custom_food"

# 全局调整(所有工位共用)
adjustment:
  offset:
    x: 0.5
    y: 1.1
    z: 0.5
  rotation:
    x: 90
    y: "0-360"
    z: 0
  scale: 0.4    # 标量写法,三轴等比缩放

# 工位级覆盖(优先级高于 adjustment)
stations:
  chopping_board:
    offset:
      y: 1.0
    scale: 0.3
  wok:
    rotation:
      y: 45

展示调整的优先级从高到低是:物品级工位覆盖 > 物品级全局调整 > 配置文件中的工位默认 > 配置文件中的全局默认。

提示

rotation 的每个轴可以写固定值(如 90)或范围(如 "0-360"),范围写法会在每次生成展示实体时随机取值。scale 支持标量写法(三轴等比)或对象写法(分别指定 x/y/z)。

Released under the GPL-3.0 License