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 是实际箱子行为的重要权限。管理员权限和模型权限分别只影响命令和可选的视觉效果。
命令
| 命令 | 权限 | 用途 |
|---|---|---|
/resurrectionchest | resurrectionchest.* | 打印一段简短的信息,指向设置流程 |
/resurrectionchest setup | resurrectionchest.setup | 打开内容设置菜单(浏览并切换箱子内容包) |
/resurrectionchest initialize | resurrectionchest.initialize | 打开首次设置菜单 |
/resurrectionchest downloadall | resurrectionchest.setup | 从 Nightbreak 下载所有可用的内容包 |
/resurrectionchest updatecontent(别名 updateall) | resurrectionchest.setup | 仅重新下载已安装的过时内容包 |
/resurrectionchest reload | resurrectionchest.* | 重新加载 ResurrectionChest |
配置项
config.yml 当前公开以下面向用户的设置:
| 配置键 | 类型 | 默认值 |
|---|---|---|
setupDone | boolean | false |
Input name for death chest | string | [DeathChest] |
Enable high compatibility / low security mode for plugin conflicts | boolean | false |
Lower worn armor's durability on death | boolean | true |
Amount of durability to lower on death | int | 100 |
Chest creation message | string | &8[ResurrectionChest] &aYou've created your Death Chest! |
Chest destruction message | string | &8[ResurrectionChest] &cYour Death Chest has been destroyed! |
Chest missing message | string | &8[ResurrectionChest] &4Your Death Chest is missing! |
Death message | string | &8[ResurrectionChest] &aYour items have been moved to your Death Chest! |
deathChestRemovedMessage | string | &8[ResurrectionChest] &cYour Death Chest has been removed! |
Enable particle effects for death chests | boolean | true |
Particle effect 1 | string | ENCHANTMENT_TABLE |
Particle effect 2 | string | ENCHANTMENT_TABLE |
Particle effect 3 | string | PORTAL |
blacklistedWorlds | list | [none] |
storeXP | boolean | true |
xpPercentageKept | double | 0.75 |
deathChestNameTag | string | $playerName's &fResurrection Chest |
freeSingleDeathChestModelName | string | resurrectionchest_free_single |
freeDoubleDeathChestModelName | string | resurrectionchest_free_double |
premiumSingleDeathChestModelName | string | resurrectionchest_angelic_single |
premiumDoubleDeathChestModelName | string | resurrectionchest_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 conflictsLower worn armor's durability on death和Amount of durability to lower on deathParticle effect 1Particle effect 2freeDoubleDeathChestModelName和premiumDoubleDeathChestModelName(插件内部硬编码了模型名称前缀resurrectionchest_free和resurrectionchest_angelic,然后根据箱子大小附加_single或_double,因此 "Double" 配置键目前不会影响箱子视觉效果)
相比之下,Particle effect 3 是在当前代码中有明显活跃使用的粒子设置(在箱子所在区块已加载时每 tick 生成)。freeSingleDeathChestModelName 和 premiumSingleDeathChestModelName 用于在分配高级前缀之前验证模型文件是否存在。