124批续23:PVPTest 备份前回收PVP/练习装备再判空,修复备份到PVP发装备致死亡还原空背包
Auto Release / build (push) Successful in 2m45s
Auto Release / build (push) Successful in 2m45s
This commit is contained in:
@@ -958,15 +958,18 @@ public class PVPTestManager implements Listener {
|
|||||||
// ==================== 背包备份/还原 ====================
|
// ==================== 背包备份/还原 ====================
|
||||||
|
|
||||||
private void backupInventory(Player p) {
|
private void backupInventory(Player p) {
|
||||||
// ★ 第124批续22:进场时背包若全空(已被 PVPArenaManager 清空),说明真实背包已被 PVP 系统
|
// ★ 第124批续22:/pvp test 进场时 PVPArenaManager 会先备份真实背包+清空+发 PVP 专属装备,
|
||||||
// 备份到 DB(按玩家名),PVPTestManager 绝不能再备份这份「空背包」当自己的还原源——
|
// PVPTestManager 随后备份。若直接备份,会把「PVP 发的专属装备」当成自己的还原源 → 死亡还原带出 PVP 装备。
|
||||||
// 否则死亡/退出时 PVPTestManager 还原空背包 → 用户「又还了个空背包」。
|
// 改:先回收背包里所有 PVP 专属/练习装备(回收PVPSpecialEquip),再看是否全空——
|
||||||
// 改:标记 inventoryOwnedByPvp,自身不备份;还原时交给 PVP 系统(DB 真实备份)。
|
// 全空说明背包本就归 PVP 系统(真实备份在 PVP DB)→ 标记 inventoryOwnedByPvp,还原读 PVP DB;
|
||||||
|
// 非空(玩家真带入了非 PVP 物品)才备份这份净背包。
|
||||||
|
int stripped = 回收PVPSpecialEquip(p);
|
||||||
boolean allEmpty = isInventoryEmpty(p);
|
boolean allEmpty = isInventoryEmpty(p);
|
||||||
if (allEmpty) {
|
if (allEmpty) {
|
||||||
inventoryOwnedByPvp.add(p.getUniqueId());
|
inventoryOwnedByPvp.add(p.getUniqueId());
|
||||||
plugin.getLogger().info("[PVP测试] 玩家 " + p.getName() + " 进场背包为空(已被PVP系统备份清空),"
|
plugin.getLogger().info("[PVP测试] 玩家 " + p.getName()
|
||||||
+ "背包还原交由 PVP 系统 DB 备份,本系统不重复备份空背包");
|
+ " 进场背包回收 " + stripped + " 件PVP/练习装备后为空(真实背包归PVP系统DB),"
|
||||||
|
+ "本系统不备份,还原交由 PVP 系统 DB 备份");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inventoryBackups.put(p.getUniqueId(), new InventoryBackup(
|
inventoryBackups.put(p.getUniqueId(), new InventoryBackup(
|
||||||
|
|||||||
Reference in New Issue
Block a user