Try to load chunk if it is not (yet) available.

This commit is contained in:
FrozenCow 2010-12-27 10:40:58 +01:00
parent 37b4d560b4
commit c2d8df8e94

View File

@ -82,9 +82,19 @@ public class MapTile {
for(x=x1; x<x2; x+=16) { for(x=x1; x<x2; x+=16) {
for(z=z1; z<z2; z+=16) { for(z=z1; z<z2; z+=16) {
if(!s.isChunkLoaded(x, 0, z)) { if(!s.isChunkLoaded(x, 0, z)) {
log.info("chunk not loaded: " + x + ", " + z + " for tile " + this.toString()); // Will try to load chunk.
//log.info("chunk not loaded: " + x + ", " + z + " for tile " + this.toString());
try {
s.loadChunk(x, 0, z);
} catch(Exception e) {
log.log(Level.SEVERE, "Caught exception from loadChunk!", e);
return false; return false;
} }
if(!s.isChunkLoaded(x, 0, z)) {
log.info("Could not load chunk: " + x + ", " + z + " for tile " + this.toString());
return false;
}
}
} }
} }