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

This commit is contained in:
Irmo van den Berge
2019-07-13 20:19:44 +02:00
committed by md_5
parent f554183c3a
commit 989f9b3daa
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
}
}
}