mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Additional check on loaded chunks : avoid getChunkAt rare exception
This commit is contained in:
parent
46ab344197
commit
3efe3c3d3d
@ -849,7 +849,6 @@ 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 = false;
|
|
||||||
boolean isunloadpending = false;
|
boolean isunloadpending = false;
|
||||||
if (queue != null) {
|
if (queue != null) {
|
||||||
isunloadpending = helper.isInUnloadQueue(queue, chunk.x, chunk.z);
|
isunloadpending = helper.isInUnloadQueue(queue, chunk.x, chunk.z);
|
||||||
@ -859,18 +858,12 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!wasLoaded) {
|
if (!wasLoaded) {
|
||||||
didload = w.loadChunk(chunk.x, chunk.z, false);
|
w.loadChunk(chunk.x, chunk.z, false);
|
||||||
}
|
|
||||||
else { /* If already was loaded, no need to load */
|
|
||||||
didload = true;
|
|
||||||
}
|
}
|
||||||
} catch (Throwable t) { /* Catch chunk error from Bukkit */
|
} catch (Throwable t) { /* Catch chunk error from Bukkit */
|
||||||
Log.warning("Bukkit error loading chunk " + chunk.x + "," + chunk.z + " on " + w.getName());
|
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 didload = w.isChunkLoaded(chunk.x, chunk.z);
|
||||||
boolean didgenerate = false;
|
|
||||||
/* If it did load, make cache of it */
|
/* If it did load, make cache of it */
|
||||||
if(didload) {
|
if(didload) {
|
||||||
tileData = new DynIntHashMap();
|
tileData = new DynIntHashMap();
|
||||||
@ -905,7 +898,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||||||
}
|
}
|
||||||
/* Get tile entity data */
|
/* Get tile entity data */
|
||||||
List<Object> vals = new ArrayList<Object>();
|
List<Object> vals = new ArrayList<Object>();
|
||||||
Map tileents = helper.getTileEntitiesForChunk(c);
|
Map<?,?> tileents = helper.getTileEntitiesForChunk(c);
|
||||||
for(Object t : tileents.values()) {
|
for(Object t : tileents.values()) {
|
||||||
int te_x = helper.getTileEntityX(t);
|
int te_x = helper.getTileEntityX(t);
|
||||||
int te_y = helper.getTileEntityY(t);
|
int te_y = helper.getTileEntityY(t);
|
||||||
|
Loading…
Reference in New Issue
Block a user