mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-18 16:35:25 +01:00
change chunk listener to monitor so we can ignore cancelled events
This commit is contained in:
parent
ad771fddc5
commit
90fe8ee882
@ -11,9 +11,10 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
public class ChunkListener implements Listener {
|
public class ChunkListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true, priority = org.bukkit.event.EventPriority.MONITOR)
|
||||||
public void onChunkUnload(ChunkUnloadEvent event) {
|
public void onChunkUnload(ChunkUnloadEvent event) {
|
||||||
final Chunk unloadingChunk = event.getChunk();
|
final Chunk unloadingChunk = event.getChunk();
|
||||||
|
|
||||||
Arrays.stream(unloadingChunk.getEntities())
|
Arrays.stream(unloadingChunk.getEntities())
|
||||||
.filter(entity -> entity instanceof LivingEntity)
|
.filter(entity -> entity instanceof LivingEntity)
|
||||||
.map(entity -> (LivingEntity) entity)
|
.map(entity -> (LivingEntity) entity)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user