From 87ebf7023fb16c52ea89f4ba745e42db7bb64019 Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Tue, 12 Sep 2017 20:01:09 -0400 Subject: [PATCH] Additional changes that are less important but related to the dupe fix. --- .../util/blockmeta/chunkmeta/PrimitiveChunkStore.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java index dca61ec81..0f111712f 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -5,6 +5,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.World; import com.gmail.nossr50.util.blockmeta.ChunkletStore; @@ -72,7 +73,7 @@ public class PrimitiveChunkStore implements ChunkStore { public boolean isEmpty() { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - for (int y = 0; y < store.length; y++) { + for (int y = 0; y < store[0][0].length; y++) { if (store[x][z][y]) { return false; } @@ -86,7 +87,7 @@ public class PrimitiveChunkStore implements ChunkStore { public void copyFrom(ChunkletStore otherStore) { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - for (int y = 0; y < store.length; y++) { + for (int y = 0; y < store[0][0].length; y++) { store[x][z][y] = otherStore.isTrue(x, y, z); } } @@ -132,10 +133,10 @@ public class PrimitiveChunkStore implements ChunkStore { private void fixArray() { boolean[][][] temp = this.store; - this.store = new boolean[16][16][temp.length]; + this.store = new boolean[16][16][Bukkit.getWorld(worldUid).getMaxHeight()]; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { - for (int y = 0; y < temp.length; y++) { + for (int y = 0; y < store[0][0].length; y++) { try { store[x][z][y] = temp[x][y][z]; }