ResurrectionChest 配置和权限
权限
| 权限 | 用途 | 默认值 |
|---|---|---|
resurrectionchest.* | 授予管理员访问 setup、content、update、reload 和 clear 命令的权限 | op |
resurrectionchest.setup | 授予管理员访问 /resurrectionchest setup、recommendedplugins、downloadallcontent 和 updatecontent 的权限 | 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 recommendedplugins | resurrectionchest.setup | 打开(或在控制台中列出)ResurrectionChest 推荐的配套插件 |
/resurrectionchest downloadall | resurrectionchest.* | 从 Nightbreak 下载插件更新(如果有)以及所有可用的内容包 |
/resurrectionchest downloadallcontent | resurrectionchest.setup | 从 Nightbreak 下载所有可用的内容包 |
/resurrectionchest updatecontent(别名 updateallcontent) | resurrectionchest.setup | 仅重新下载已安装的过时内容包 |
/resurrectionchest forcereinstallcontent <package|all> | resurrectionchest.* | 即使已安装版本已是最新,也重新下载某个内容包(或所有已下载的内容包)。包名会 Tab 补全为 Nightbreak 的 slug wooden-chest 和 angelic-chest,以及 all |
/resurrectionchest downloadpluginupdate | resurrectionchest.* | 如果有可用的 ResurrectionChest 插件更新,则下载它 |
/resurrectionchest reload | resurrectionchest.* | 重新加载 ResurrectionChest |
/resurrectionchest clear | resurrectionchest.* | 清除所有被跟踪的 ResurrectionChest 方块;掉落每个被跟踪箱子的库存内容,并移除箱子和告示牌方块 |
下载的插件更新会被放入服务器的 update 文件夹,并仅在下次服务器重启后生效。
插件文件
| 路径 | 用途 |
|---|---|
plugins/ResurrectionChest/config.yml | 下表中的所有设置 |
plugins/ResurrectionChest/playerData.yml | 每个已注册箱子一条记录,以玩家 UUID 为键:箱子的 location、注册该箱子时选定的 chestModel 前缀,以及用于把较旧的注册迁移到当前方块归属标记体系的 trackedBlockSchemaVersion |
plugins/ResurrectionChest/content_packages/ | wooden_chest.yml / angelic_chest.yml 内容包定义(名称、描述、下载链接、版本、isEnabled、category) |
plugins/ResurrectionChest/nightbreak-changelogs.yml | /resurrectionchestchangelog 背后共享更新日志收件箱的已读/已忽略状态。参见更新日志通知 |
plugins/ResurrectionChest/imports/ | 手动导入的投放文件夹。放在这里的内容会在启动时解包 —— 模型文件会被分发到 FreeMinecraftModels,并自动刷新 FreeMinecraftModels。参见手动导入与游戏内管理的对比 |
请勿在服务器运行期间手动编辑 playerData.yml;每当箱子被注册或移除时,ResurrectionChest 都会重写该文件。
配置项
config.yml 当前公开以下面向用户的设置:
| 配置键 | 类型 | 默认值 |
|---|---|---|
setupDone | boolean | false |
nightbreak.autoDownloadPluginUpdates | 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! |
Chest protected region message | string | &8[ResurrectionChest] &cYou can't create a Death Chest here - this area is protected! |
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 |
插件和内容自动更新
nightbreak.autoDownloadPluginUpdates 是随 ResurrectionChest 一起提供的共享 Nightbreak/MagmaCore 设置。它默认为 false。
- 当为
false(默认)时,不会自动下载任何内容。ResurrectionChest 仍会在启动时(以及大约每小时一次)检查插件更新,以便游戏内的更新按钮可以显示结果,但实际的下载需要你自己触发。 - 当为
true时,ResurrectionChest 会在启动时下载可用的插件更新和过时的内容包。下载的插件和内容更新仅在服务器重启后才会被使用。 - 自动下载插件需要有效的 Nightbreak 账户令牌和有效的支持者会员资格。
你可以在游戏内通过 /resurrectionchest setup 工具栏中的 自动更新(Automatic Updates) 切换按钮来翻转此设置,或者直接编辑 config.yml。
设置菜单还提供一个 插件更新(Plugin Update) 条目(显示已安装/可用版本,点击即可下载更新)和一个 推荐插件(Recommended Plugins) 条目(与 /resurrectionchest recommendedplugins 相同的列表)。
区域保护
注册死亡箱子被视为建造行为:在告示牌被接受之前,ResurrectionChest 会通过 MagmaCore 共享的 LocationQueryRegistry 询问玩家是否可以在该箱子方块处建造。
- WorldGuard 和 GriefPrevention 会被自动包装;如果两者都未安装,则不会有额外限制,注册行为与以前完全一致。
- 如果保护插件拒绝建造,注册会被拒绝,并向玩家发送
Chest protected region message。 - 如果某个保护适配器抛出错误,查询会以拒绝方式失败(注册被拒绝),而不是悄悄绕过保护。
适配器是在启动期间附加的,因此任何附加失败都会出现在启动日志中,而不是在第一次注册箱子时才暴露。
盔甲耐久度惩罚
Lower worn armor's durability on death(默认 true)和 Amount of durability to lower on death(默认 100)会在玩家穿戴的盔甲被路由进死亡箱子的过程中生效:
- 出现在死亡掉落物中的每一件穿戴盔甲,其损伤值都会增加
Amount of durability to lower on death - 如果这会让该物品达到或超过其最大耐久度,该物品会被完全从掉落物中移除(它被销毁而不是被存储)
- 否则被损伤后的物品就是最终放入箱子的那一件
该惩罚只在 ResurrectionChest 实际处理的死亡上运行——当 keepInventory 开启、世界在黑名单中、玩家缺少 resurrectionchest.use,以及注册的箱子丢失时,都会跳过它。
高兼容性模式
Enable high compatibility / low security mode for plugin conflicts默认为false,此时登记的告示牌或箱子必须保留正确的所有者标记。
设为true后,登记位置缺失标记可以被接受。但其他所有者的标记仍会被拒绝,登记的箱子仍必须是箱子方块。此模式用于兼容删除标记的插件,并不接受任意替换方块。
经验值处理
当 storeXP 启用时:
- ResurrectionChest 在游戏过程中跟踪玩家的总经验值,但会在死亡的那一刻读取玩家的实时总量,因此通过其他插件的 API 直接授予的经验值同样会被计入
- 死亡时,存储
总经验值 * xpPercentageKept - 将掉落的经验值设置为
0 - 当拥有者下次打开注册箱子时返还存储的经验值(双箱的任意一侧都算)
- 在领取之前再次死亡会累加到已存储的数量上,而不是替换它
xpPercentageKept 在读取配置时会被钳制到 0-1 范围内,因此大于 1 的值按 1 处理,负值或无效值按 0 处理。
重要例外:
- 如果
keepInventory处于激活状态,ResurrectionChest 不做任何事。 - 如果
keepLevel处于激活状态,经验值存储分支会被跳过,并保持原版等级处理不变。 - 存储的经验值仅保存在内存中。它不会写入
playerData.yml,因此服务器重启、/resurrectionchest reload或插件重载都会丢弃尚未领取的经验值。箱子内已有的物品不受影响。
溢出处理
物品是按堆逐个放入箱子的,并且允许部分放入:
- 能放下的部分会被存储,包括补满已有的堆叠
- 只有剩余的数量会留在死亡地点的正常死亡掉落列表中
- 玩家收到箱子已满的警告
FreeMinecraftModels 集成
如果安装了 FreeMinecraftModels,ResurrectionChest 可以在真实箱子上方生成视觉箱子模型。
当前行为:
- 当玩家拥有
resurrectionchest.model.premium并且 高级模型实际已加载时,优先使用高级视觉效果(神圣箱子) - 否则,当玩家拥有
resurrectionchest.model.free时,使用免费视觉效果(木质箱子) - 如果两个权限都无法提供可用的模型,则不生成模型,原样使用原版箱子
- 视觉模型根据箱子大小在单箱和双箱变体之间切换
- 真实箱子仍然是存储后端
模型的选择只在箱子注册时进行一次,并作为该箱子的 chestModel 存储在 playerData.yml 中。由此带来两个后果:
- 如果注册时尚未安装 FreeMinecraftModels,该箱子会被记录为没有模型,即使之后安装了 FreeMinecraftModels,它也仍然是一个普通的原版箱子
- 之后的权限变更不会追溯性地升级或降级已存在的箱子
在这两种情况下,玩家都必须重新注册箱子(破坏它并重新放置告示牌)才能采用新的模型。
当自定义箱子模型处于活动状态时,玩家可以直接与其交互:
- 右键单击模型以打开底层箱子库存
- 左键单击模型以移除注册(只有拥有者可以这样做;非拥有者左键单击会收到一条红色消息,且不会销毁任何东西)
如果 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 之外没有任何引用的配置条目:
Particle effect 1Particle effect 2freeSingleDeathChestModelNamefreeDoubleDeathChestModelName和premiumDoubleDeathChestModelName(插件内部硬编码了模型名称前缀resurrectionchest_free和resurrectionchest_angelic,然后根据箱子大小附加_single或_double,因此 "Double" 配置键目前不会影响箱子视觉效果)
相比之下,Particle effect 3 是在当前代码中有明显活跃使用的粒子设置:它在加载时解析一次(若名称不是有效粒子,则回退为 PORTAL 并输出一条控制台警告),随后在箱子所在区块已加载时每 tick 生成。将 Enable particle effects for death chests 设为 false 会完全取消这个逐 tick 任务,在注册箱子很多的服务器上这是开销最低的选项。premiumSingleDeathChestModelName 用于在分配高级前缀之前验证高级模型文件是否存在;免费模型文件的存在性不会单独检查。
还有两点关于命令层面的注意事项:
/resurrectionchest initialize打开首次设置,需要resurrectionchest.initialize。/resurrectionchest setup打开内容、更新和推荐插件管理。/resurrectionchest clear并非只针对某一个玩家。它会一次性清除服务器上所有已注册的箱子。