Add workaround for Spigot 1.13.2 bug with loadChunk(x,z,false)

Workaround problem with fact that World.loadChunk(x, z, false) fails
when called on existing chunks that have not been migrated to 1.13.x
format.
This commit is contained in:
Mike Primm 2018-12-01 19:22:47 -06:00
parent f674e4a79b
commit ca7f353e0d
2 changed files with 27 additions and 1 deletions

View file

@ -796,7 +796,7 @@ public abstract class AbstractMapChunkCache extends MapChunkCache {
wasLoaded = true;
}
try {
didload = w.loadChunk(chunk.x, chunk.z, false);
didload = loadChunkNoGenerate(w, chunk.x, chunk.z);
} catch (Throwable t) { /* Catch chunk error from Bukkit */
Log.warning("Bukkit error loading chunk " + chunk.x + "," + chunk.z + " on " + w.getName());
if(!wasLoaded) { /* If wasn't loaded, we loaded it if it now is */
@ -1013,6 +1013,10 @@ public abstract class AbstractMapChunkCache extends MapChunkCache {
return dw;
}
public boolean loadChunkNoGenerate(World w, int x, int z) {
return w.loadChunk(x, z, false);
}
static {
Biome[] b = Biome.values();
BiomeMap[] bm = BiomeMap.values();