Skip to content

Commit

Permalink
Fixed the plugin loading chunks after they are unloaded causing tps d…
Browse files Browse the repository at this point in the history
…rops (#1298)
  • Loading branch information
OmerBenGera committed Jul 28, 2022
1 parent 7a950d1 commit 0394852
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -86,9 +86,11 @@ public void onChunkLoad(ChunkLoadEvent e) {
if (!creatureSpawners.isEmpty()) {
// We want to replace the spawner in a delay so other plugins that might change the spawner will be taken in action as well.
BukkitExecutor.sync(() -> {
creatureSpawners.forEach(creatureSpawner -> {
plugin.getNMSWorld().listenSpawner(creatureSpawner, spawnDelay -> calculateNewSpawnerDelay(island, spawnDelay));
});
if (e.getChunk().isLoaded()) {
creatureSpawners.forEach(creatureSpawner -> {
plugin.getNMSWorld().listenSpawner(creatureSpawner, spawnDelay -> calculateNewSpawnerDelay(island, spawnDelay));
});
}
}, 20L);
}

Expand Down

0 comments on commit 0394852

Please sign in to comment.