change chunk listener to monitor so we can ignore cancelled events

This commit is contained in:
nossr50 2025-01-03 15:19:46 -08:00
parent ad771fddc5
commit 90fe8ee882

View File

@ -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)