第124批续25: 靶场空背包(双系统踩踏) + 堆叠0信任自动炸开
Auto Release / build (push) Successful in 2m26s

- PVPArenaManager.onPlayerEnterPVPWorld: pvp_test 靶场世界由 PVPTestManager 独占管理背包,本系统跳过备份/清空/选装,
  消除双系统 backup+clear 互相踩踏导致还原读 DB 旧坏备份→空白背包的根因。
- StackConfigManager.rescanPlayerInventory: 0信任(clearAll/坏配置)时不再走 restoreDefaultStackSize(unsetData返回true短路),
  直接 burstItem 强制拆分——64蛋→4×16自动炸开,无需玩家手动点击。
This commit is contained in:
youpaishidifu
2026-11-18 16:46:54 +08:00
parent fd84fe66a6
commit 942d34797a
2 changed files with 16 additions and 4 deletions
@@ -1653,7 +1653,17 @@ public class PVPArenaManager implements Listener {
// 错5次弹回出生点。命令入口(passwordVerified)已校验过密码,不再拦。
// 提前 return:不登记 inPVPArena、不清背包、不开选装 GUI、不启动 60 秒踢人计时,
// 输对后由 handlePasswordInput 放行重走本流程。
// ★ 续25(靶场空背包根因,2026-11-18):pvp_test 靶场世界由 PVPTestManager 独占管理背包。
// 此前 isPVPWorld 匹配 pvp_ 前缀把 pvp_test 也接管,本系统 onPlayerEnterPVPWorld 会
// backupInventory(skipDb=false 写 DB)+clearInventory+选装GUI,与 PVPTestManager.startTest
// 的备份/清空/发装备互相踩踏,还原时本系统读 DB 旧坏备份 → 死亡/离场还原空白背包。
// 靶场背包全程交给 PVPTestManager,本系统对 pvp_test 世界直接放行。
String worldName = player.getWorld().getName();
if (PVPTestManager.PVP_TEST_WORLD_NAME.equals(worldName)) {
plugin.getLogger().info("[PVP] 玩家 " + playerName + " 进入靶场世界 " + worldName
+ ",背包由 PVP测试系统独占管理,本系统跳过备份/清空/选装");
return;
}
if (isPrivateRoomWorld(worldName)
&& passwordRoomPwd.containsKey(worldName)
&& !passwordRoomPwd.get(worldName).isEmpty()
@@ -490,10 +490,12 @@ public class StackConfigManager implements Listener {
int cfgMax = getMaxStackSize(item.getType());
if (cfgMax <= 0) {
// ★ 续24(0信任模式):停用/映射被清空 → 已堆叠物品强制炸开到 vanilla 默认,
// 不依赖玩家手动拆。restoreDefault 交还原版组件;数量超默认则原地拆分。
boolean restored = restoreDefaultStackSize(item);
int burst = restored ? 0 : burstItem(inv, i, item);
if (restored || burst > 0) {
// 不依赖玩家手动拆。burstItem 内部统一处理:
// 数量超默认 → 拆分到多个相邻空槽(每份≤默认)并 unsetData 交还原版;
// 数量未超 → 仅 unsetData 交还原版组件。无需先调 restoreDefaultStackSize
// (其 unsetData 返回 true 会短路 burstItem,导致 64 蛋仍是一格 64 不炸开)。
int burst = burstItem(inv, i, item);
if (burst > 0) {
inv.setItem(i, item);
changed++;
}