From 90fe8ee88245f3d00760db553dcf557ffe12cfa6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 3 Jan 2025 15:19:46 -0800 Subject: [PATCH] change chunk listener to monitor so we can ignore cancelled events --- src/main/java/com/gmail/nossr50/listeners/ChunkListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java b/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java index 000d3ca8c..28524adeb 100644 --- a/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java @@ -11,9 +11,10 @@ import java.util.Arrays; public class ChunkListener implements Listener { - @EventHandler(ignoreCancelled = true) + @EventHandler(ignoreCancelled = true, priority = org.bukkit.event.EventPriority.MONITOR) public void onChunkUnload(ChunkUnloadEvent event) { final Chunk unloadingChunk = event.getChunk(); + Arrays.stream(unloadingChunk.getEntities()) .filter(entity -> entity instanceof LivingEntity) .map(entity -> (LivingEntity) entity)