From a5428b56f1d47ec3dd0d3b12a38be94f4a110f12 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 16 Jul 2012 00:51:13 -0500 Subject: [PATCH] Handle exceptions from Bukkit on chunk loads - keep from being killed by them... --- src/main/java/org/dynmap/bukkit/NewMapChunkCache.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java b/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java index f6c62551..9e5e55a6 100644 --- a/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java +++ b/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java @@ -796,7 +796,15 @@ public class NewMapChunkCache implements MapChunkCache { } chunks_attempted++; 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; /* If we didn't load, and we're supposed to generate, do it */ if((!didload) && do_generate && vis)