Attempting to fix index error.

This commit is contained in:
Glitchfinder 2012-11-04 20:36:47 -08:00
parent 83e072dad1
commit 62f5185a1b
2 changed files with 10 additions and 2 deletions

View File

@ -71,7 +71,7 @@ public class WorldListener implements Listener {
manager.loadChunk(cx, cz, world);
for(int y = 0; y < 4; y++) {
for(int y = 0; y < (world.getMaxHeight() / 64); y++) {
String chunkletName = world.getName() + "," + cx + "," + cz + "," + y;
ChunkletStore tempChunklet = manager.store.get(chunkletName);
PrimitiveChunkletStore primitiveChunklet = null;
@ -120,6 +120,10 @@ public class WorldListener implements Listener {
else
return;
boolean[] newArray = cChunk.store[x][z];
if(oldArray.length < 64)
return;
else if(newArray.length < ((y * 64) + 64))
return;
System.arraycopy(oldArray, 0, newArray, (y * 64), 64);
}
}

View File

@ -82,7 +82,7 @@ public class BlockStoreConversionZDirectory implements Runnable {
this.manager.loadChunk(this.cx, this.cz, this.world);
for(this.y = 0; this.y < 4; this.y++) {
for(this.y = 0; this.y < (this.world.getMaxHeight() / 64); this.y++) {
this.chunkletName = this.world.getName() + "," + this.cx + "," + this.cz + "," + this.y;
this.tempChunklet = this.manager.store.get(this.chunkletName);
if(this.tempChunklet instanceof PrimitiveChunkletStore)
@ -128,6 +128,10 @@ public class BlockStoreConversionZDirectory implements Runnable {
else
return;
this.newArray = this.currentChunk.store[x][z];
if(this.oldArray.length < 64)
return;
else if(this.newArray.length < ((this.y * 64) + 64))
return;
System.arraycopy(this.oldArray, 0, this.newArray, (this.y * 64), 64);
}
}