diff --git a/src/main/java/Sdf1_login/AchievementEffectGuard.java b/src/main/java/Sdf1_login/AchievementEffectGuard.java index df72166..ac5ee4b 100644 --- a/src/main/java/Sdf1_login/AchievementEffectGuard.java +++ b/src/main/java/Sdf1_login/AchievementEffectGuard.java @@ -356,7 +356,11 @@ public class AchievementEffectGuard implements Listener { if (!pvpPreExisting.containsKey(p.getUniqueId())) { ensurePvpSnapshot(p); } - if (pvpPreExisting.getOrDefault(p.getUniqueId(), java.util.Collections.emptySet()).contains(key)) { + // ★ 第124批续1:事件 key 带 minecraft: 前缀,快照存短 key, + // contains 前必须归一化——否则永远不命中,快照检查形同虚设, + // 老玩家手打成就被误撤(生产 20:51/21:39 实锤)。 + String plainKey = key.startsWith("minecraft:") ? key.substring("minecraft:".length()) : key; + if (pvpPreExisting.getOrDefault(p.getUniqueId(), java.util.Collections.emptySet()).contains(plainKey)) { return; } // ★ 同成就 60 秒冷却:grant 高频(每次护甲变动都派发), @@ -453,7 +457,10 @@ public class AchievementEffectGuard implements Listener { if (!pvpPreExisting.containsKey(p.getUniqueId())) { ensurePvpSnapshot(p); } - if (pvpPreExisting.getOrDefault(p.getUniqueId(), java.util.Collections.emptySet()).contains(key)) { + // ★ 第124批续1:同 grant 路径,事件 key 带前缀,快照存短 key, + // contains 前先归一化,否则老玩家手打成就必被误撤。 + String plainKey = key.startsWith("minecraft:") ? key.substring("minecraft:".length()) : key; + if (pvpPreExisting.getOrDefault(p.getUniqueId(), java.util.Collections.emptySet()).contains(plainKey)) { return; } if (!armorRevokeCooldown.add(p.getUniqueId() + ":" + key)) { @@ -715,6 +722,8 @@ public class AchievementEffectGuard implements Listener { if (isDone(p, key)) snapshot.add(key); } pvpPreExisting.put(uid, snapshot); + plugin.getLogger().info("[成就防作弊] 进场快照 玩家=" + p.getName() + + " 已有(手打)成就=" + snapshot + " 监管范围=" + allGuardedKeys()); } /** 是否是本守卫管的三条装备成就 */