Skip to content

导入 / 导出

所属:开发者 · 相关:命令

QI 支持从 MMOItems / NeigeItems 导入物品,以及把内容打包成 .qipack 导出 / 导入

🧭 想要从头迁移的完整步骤 + 字段映射对照表 + dry-run 解读?看 导入 / 导出实操手册


1. 导入外部物品

把 MMOItems / NeigeItems 的物品配置放进 plugins/QinhItems/imports/ 目录,用命令导入。

命令用途
/qi imports显示导入文件数
/qi imports list列出导入文件
/qi imports run执行导入
/qi imports dry-run预览(不真正导入)
/qi migrate迁移旧物品源(带校验)
/qi migrate dry-run预览迁移

支持格式

格式导入内容
mmoitemsbase.*、stats、ability、permission、required-level、required-class、perm-effects
neigeitemssections、FancyDrop、actions、actions_file、data
generic未知格式的兜底

MMOItems 属性映射

  • 核心属性 → 基础值attack-damagebase_attack_damagemax-healthbase_healthdefensebase_defense
  • 普通属性attack-speedmagic-damagearmor-penetrationmax-manamana-regeneration
  • 比率属性(÷100)critical-strike-chancecritical_ratedodge-ratingblock-ratinglifesteal

MMOItems 技能映射(ability → 触发器)

MMOItemsQI 触发器
attack / on_hiton_damage
damaged / when_hiton_hit
right_click / left_click / shift_*同名
sneakshift_toggle
kill_entityon_kill
shoot_bowbow_shoot
shoot_tridenttrident_throw
death / logindeath / join

限制映射

MMOItemsQI
required-level: Nlevel:N
required-class: A,Bclass:A,B(委托 QinhItemUseCheckEvent
permission: Xpermission:X

API

kotlin
QinhItemImportService.importAll(dryRun = false): ImportReport
QinhItemImportService.migrateLegacySources(dryRun): ImportReport
QinhItemImportService.importFiles(files, dryRun): ImportReport

ImportReport 含:扫描文件数、导入数、导入 ID、各格式计数、映射字段、生成的段 / 词缀、警告 / 错误。


2. 内容包(.qipack)

把当前 QI 内容(物品引用的段 / 词缀 / 层快照)打包成单文件,便于跨服分发。

命令用途
/qi packs显示包文件数与目录
/qi packs list列出包文件
/qi packs export导出所有内容到文件
/qi packs import导入(= apply / sync)
/qi packs sync同步(刷新 + 导出)
/qi packs apply应用(= sync)
/qi packs gui打开内容包编辑 GUI

导出

kotlin
QinhItemPackExportService.exportAll(targetFileName = "qinhitems-pack.yml"): PackExportReport

导出结构:metadata(计数、ID、各格式分布、schema 版本)+ sections + affixes + layerSnapshots + 每物品的 section_ids / affix_ids / layer_summary。

导入

kotlin
QinhItemPackImportService.importFile(file): PackImportReport

导入会校验声明数与实际加载数是否一致(structureMismatch / mismatchSummary),缺 metadata 时从节点键回退计算。


3. 导入产物转换

kotlin
QinhItemImportArtifacts.toSection(id, mappingResult): QinhSection
QinhItemImportArtifacts.toAffix(id, mappingResult): QinhAffix

把导入映射结果转成 / 词缀,注册进层系统。


下一步