跳到主要内容

ResurrectionChest 配置和权限

权限

权限用途默认值
resurrectionchest.*授予管理员访问 setup、initialize、downloadall、updatecontent 和 reload 命令的权限op
resurrectionchest.setup授予管理员访问 /resurrectionchest setup 命令的权限op
resurrectionchest.initialize授予管理员访问 /resurrectionchest initialize 命令的权限op
resurrectionchest.use允许玩家注册箱子并将死亡掉落物路由到其中true
resurrectionchest.model.free允许玩家使用免费的 FreeMinecraftModels 箱子视觉效果(木质箱子)true
resurrectionchest.model.premium允许玩家使用高级的 FreeMinecraftModels 箱子视觉效果(神圣箱子)op

resurrectionchest.use 是实际箱子行为的重要权限。管理员权限和模型权限分别只影响命令和可选的视觉效果。

命令

命令权限用途
/resurrectionchestresurrectionchest.*打印一段简短的信息,指向设置流程
/resurrectionchest setupresurrectionchest.setup打开内容设置菜单(浏览并切换箱子内容包)
/resurrectionchest initializeresurrectionchest.initialize打开首次设置菜单
/resurrectionchest downloadallresurrectionchest.setup从 Nightbreak 下载所有可用的内容包
/resurrectionchest updatecontent(别名 updateallresurrectionchest.setup仅重新下载已安装的过时内容包
/resurrectionchest reloadresurrectionchest.*重新加载 ResurrectionChest

配置项

config.yml 当前公开以下面向用户的设置:

配置键类型默认值
setupDonebooleanfalse
Input name for death cheststring[DeathChest]
Enable high compatibility / low security mode for plugin conflictsbooleanfalse
Lower worn armor's durability on deathbooleantrue
Amount of durability to lower on deathint100
Chest creation messagestring&8[ResurrectionChest] &aYou've created your Death Chest!
Chest destruction messagestring&8[ResurrectionChest] &cYour Death Chest has been destroyed!
Chest missing messagestring&8[ResurrectionChest] &4Your Death Chest is missing!
Death messagestring&8[ResurrectionChest] &aYour items have been moved to your Death Chest!
deathChestRemovedMessagestring&8[ResurrectionChest] &cYour Death Chest has been removed!
Enable particle effects for death chestsbooleantrue
Particle effect 1stringENCHANTMENT_TABLE
Particle effect 2stringENCHANTMENT_TABLE
Particle effect 3stringPORTAL
blacklistedWorldslist[none]
storeXPbooleantrue
xpPercentageKeptdouble0.75
deathChestNameTagstring$playerName's &fResurrection Chest
freeSingleDeathChestModelNamestringresurrectionchest_free_single
freeDoubleDeathChestModelNamestringresurrectionchest_free_double
premiumSingleDeathChestModelNamestringresurrectionchest_angelic_single
premiumDoubleDeathChestModelNamestringresurrectionchest_angelic_double

经验值处理

storeXP 启用时:

  • ResurrectionChest 在游戏过程中跟踪玩家当前的总经验值
  • 死亡时,存储 跟踪的总经验值 * xpPercentageKept
  • 将掉落的经验值设置为 0
  • 当拥有者下次打开注册箱子时返还存储的经验值

重要例外:

  • 如果 keepInventory 处于激活状态,ResurrectionChest 不做任何事。
  • 如果 keepLevel 处于激活状态,经验值存储分支提前退出,并保持原版等级处理不变。

溢出处理

如果箱子没有空闲槽位放置物品:

  • 该物品留在正常的死亡掉落列表中
  • 玩家收到箱子已满的警告

FreeMinecraftModels 集成

如果安装了 FreeMinecraftModels,ResurrectionChest 可以在真实箱子上方生成视觉箱子模型。

当前行为:

  • 当玩家拥有 resurrectionchest.model.premium 并且 高级模型实际已加载时,优先使用高级视觉效果(神圣箱子)
  • 否则,当玩家拥有 resurrectionchest.model.free 时,使用免费视觉效果(木质箱子)
  • 如果两个权限都无法提供可用的模型,则不生成模型,原样使用原版箱子
  • 视觉模型根据箱子大小在单箱和双箱变体之间切换
  • 真实箱子仍然是存储后端

当自定义箱子模型处于活动状态时,玩家可以直接与其交互:

  • 右键单击模型以打开底层箱子库存
  • 潜行 + 左键单击模型以移除注册(只有拥有者可以这样做)
  • 不潜行的左键单击会显示黄色警告,而不是销毁箱子

如果 FreeMinecraftModels 缺失或模型无法生成,底层箱子仍然正常工作。

内容包

ResurrectionChest 附带两个内容包,封装了 FreeMinecraftModels 的箱子模型:

  • 木质箱子(免费):提供 resurrectionchest_free_single / resurrectionchest_free_double。由 resurrectionchest.model.free 使用。
  • 神圣箱子(高级):提供 resurrectionchest_angelic_single / resurrectionchest_angelic_double。由 resurrectionchest.model.premium 使用。

每个内容包安装时位于 FreeMinecraftModels 的 models 文件夹下,卸载时位于 models_disabled 文件夹下。通过 /resurrectionchest setup 切换它们会在这些文件夹之间移动文件,并自动重新加载 FreeMinecraftModels。

基于源代码的注意事项

当前源代码显示了一些在 config.yml 中公开但在 DefaultConfig 之外没有任何引用的配置条目:

  • Enable high compatibility / low security mode for plugin conflicts
  • Lower worn armor's durability on deathAmount of durability to lower on death
  • Particle effect 1
  • Particle effect 2
  • freeDoubleDeathChestModelNamepremiumDoubleDeathChestModelName(插件内部硬编码了模型名称前缀 resurrectionchest_freeresurrectionchest_angelic,然后根据箱子大小附加 _single_double,因此 "Double" 配置键目前不会影响箱子视觉效果)

相比之下,Particle effect 3 是在当前代码中有明显活跃使用的粒子设置(在箱子所在区块已加载时每 tick 生成)。freeSingleDeathChestModelNamepremiumSingleDeathChestModelName 用于在分配高级前缀之前验证模型文件是否存在。