mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-24 13:22:50 +02:00
Delay processing of chunkloadevent
This commit is contained in:
parent
530e175094
commit
82e4f2dcea
@ -142,7 +142,17 @@ public class EventListen implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onChunkLoad(ChunkLoadEvent event) {
|
||||
respawnAllFromCoord(new ChunkCoord(event.getChunk()));
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
respawnAllFromCoord(new ChunkCoord(event.getChunk()));
|
||||
}
|
||||
};
|
||||
if (event instanceof Cancellable) {
|
||||
runnable.run();
|
||||
} else {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), runnable);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user