Added method to clear specific player's kill attempts

This commit is contained in:
IM23a-spirgif
2025-04-28 10:18:09 +02:00
parent 15d47c2c6d
commit 00ff6491f3
@@ -102,8 +102,6 @@ public class MobKillHandler {
} }
updated.put(knockedId, attempt); updated.put(knockedId, attempt);
} }
// 5) Replace the map
killAttempts.clear(); killAttempts.clear();
killAttempts.putAll(updated); killAttempts.putAll(updated);
} }
@@ -150,4 +148,8 @@ public class MobKillHandler {
var srv = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); var srv = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer();
return srv != null ? srv.getPlayerList().getPlayer(id) : null; return srv != null ? srv.getPlayerList().getPlayer(id) : null;
} }
public static void clearKillAttempt(UUID playerUuid) {
killAttempts.remove(playerUuid);
}
} }