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 箱子視覺效果(Wooden Chest) | true |
resurrectionchest.model.premium | 允許玩家使用進階的 FreeMinecraftModels 箱子視覺效果(Angelic Chest) | 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 代號 wooden-chest 與 angelic-chest,外加 all |
/resurrectionchest downloadpluginupdate | resurrectionchest.* | 若有可用的 ResurrectionChest 插件更新則下載之 |
/resurrectionchest reload | resurrectionchest.* | 重新載入 ResurrectionChest |
/resurrectionchest clear | resurrectionchest.* | 清除每個被追蹤的 ResurrectionChest 方塊;掉落每個被追蹤箱子的物品欄內容,並移除箱子與告示牌方塊 |
已下載的插件更新會放置在伺服器的更新資料夾中,且僅在下次伺服器重啟後才會生效。
插件檔案
| 路徑 | 用途 |
|---|---|
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且進階模型確實已載入時,優先使用進階視覺效果(Angelic Chest) - 否則,當玩家擁有
resurrectionchest.model.free時,使用免費視覺效果(Wooden Chest) - 如果兩個權限皆未提供可用的模型,則不會生成模型,並按原樣使用原版箱子
- 視覺模型會根據箱子大小在單箱和雙箱變體之間切換
- 真實箱子仍然是儲存後端
模型選擇只會在箱子註冊時決定一次,並以該箱子的 chestModel 儲存在 playerData.yml 中。這造成兩個後果:
- 若註冊當下尚未安裝 FreeMinecraftModels,該箱子會被記錄為沒有模型,即使之後安裝了 FreeMinecraftModels,它仍會是一般的原版箱子
- 之後的權限變更不會回溯升級或降級既有的箱子
這兩種情況下,玩家都必須重新註冊該箱子(打掉它並再次放置告示牌)才能取得新的模型。
當自訂模型處於啟用狀態時,玩家可以直接與其互動:
- 右鍵點擊模型可開啟底層箱子的物品欄
- 左鍵點擊模型可銷毀註冊(僅限箱子擁有者可以這麼做;非擁有者左鍵點擊會收到紅色訊息,且不會銷毀任何東西)
如果 FreeMinecraftModels 缺失或模型無法生成,底層箱子仍可正常運作。
內容包
ResurrectionChest 附帶兩個包裝了 FreeMinecraftModels 箱子模型的內容包:
- Wooden Chest(免費):提供
resurrectionchest_free_single/resurrectionchest_free_double。由resurrectionchest.model.free使用。 - Angelic Chest(進階):提供
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並不會限定於單一玩家。它會一次清除伺服器上每一個已註冊的箱子。