Hoist out synchronisation from ChunkRegionLoader

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-09-10 19:13:03 +10:00
parent de1ca9f6ed
commit 5d0094a169
2 changed files with 18 additions and 30 deletions

View File

@@ -84,7 +84,7 @@
++i;
}
}
@@ -267,6 +291,40 @@
@@ -267,6 +291,42 @@
return false;
}
@@ -112,12 +112,14 @@
+ }
+ }
+ // Moved from unloadChunks above
+ chunk.removeEntities();
+ if (save) {
+ this.saveChunk(chunk);
+ synchronized (this.chunkLoader) {
+ chunk.removeEntities();
+ if (save) {
+ this.saveChunk(chunk);
+ }
+ this.chunks.remove(chunk.chunkKey);
+ this.lastChunk = null;
+ }
+ this.chunks.remove(chunk.chunkKey);
+ this.lastChunk = null;
+ return true;
+ }
+ // CraftBukkit end