Handle exceptions from Bukkit on chunk loads - keep from being killed by them...
This commit is contained in:
parent
02eaef3323
commit
419cbb8f1f
1 changed files with 9 additions and 1 deletions
|
|
@ -796,7 +796,15 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||||
}
|
}
|
||||||
chunks_attempted++;
|
chunks_attempted++;
|
||||||
boolean wasLoaded = w.isChunkLoaded(chunk.x, chunk.z);
|
boolean wasLoaded = w.isChunkLoaded(chunk.x, chunk.z);
|
||||||
boolean didload = w.loadChunk(chunk.x, chunk.z, false);
|
boolean didload = false;
|
||||||
|
try {
|
||||||
|
didload = w.loadChunk(chunk.x, chunk.z, false);
|
||||||
|
} 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 */
|
||||||
|
didload = w.isChunkLoaded(chunk.x, chunk.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
boolean didgenerate = false;
|
boolean didgenerate = false;
|
||||||
/* If we didn't load, and we're supposed to generate, do it */
|
/* If we didn't load, and we're supposed to generate, do it */
|
||||||
if((!didload) && do_generate && vis)
|
if((!didload) && do_generate && vis)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue