SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate events

By: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
This commit is contained in:
CraftBukkit/Spigot
2019-07-13 20:19:44 +02:00
parent a30fef9d1f
commit 75c992cac3
3 changed files with 77 additions and 20 deletions

View File

@@ -102,3 +102,22 @@
if (object2intmap.getInt(enumcreaturetype) <= k1) {
SpawnerCreature.a(enumcreaturetype, (World) this.world, chunk, blockposition);
@@ -447,12 +489,18 @@
@Override
protected boolean executeNext() {
+ // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
+ try {
if (ChunkProviderServer.this.tickDistanceManager()) {
return true;
} else {
ChunkProviderServer.this.lightEngine.queueUpdate();
return super.executeNext();
}
+ } finally {
+ playerChunkMap.callbackExecutor.run();
+ }
+ // CraftBukkit end
}
}
}