Skip to content

Commit

Permalink
dont forget to listen for deaths
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Sep 5, 2024
1 parent d2364d1 commit 9024a3e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

import java.time.Duration;
import java.util.Set;
Expand Down Expand Up @@ -59,6 +60,11 @@ public void disable() {
if (PlatformUtil.isFolia()) PacketEvents.getAPI().getEventManager().unregisterListener(asAbstract);
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onPlayerDeath(PlayerDeathEvent event) {
DEAD_PLAYERS.add(event.getPlayer().getUniqueId());
}

@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
private void onPlayerPostRespawn(PlayerPostRespawnEvent event) {
Expand Down

0 comments on commit 9024a3e

Please sign in to comment.