diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitQueueCoordinator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitQueueCoordinator.java index 96ca41f4e..e104b80e8 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitQueueCoordinator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitQueueCoordinator.java @@ -179,7 +179,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { } } } - for (int layer = 0; layer < localChunk.getBaseblocks().length; layer++) { + for (int layer = 0; layer < localChunk.getBiomes().length; layer++) { BiomeType[] biomesLayer = localChunk.getBiomes()[layer]; if (biomesLayer == null) { continue; diff --git a/Core/src/main/java/com/plotsquared/core/queue/LocalChunk.java b/Core/src/main/java/com/plotsquared/core/queue/LocalChunk.java index f9e8e4f2d..86ab6bafb 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/LocalChunk.java +++ b/Core/src/main/java/com/plotsquared/core/queue/LocalChunk.java @@ -54,7 +54,7 @@ public class LocalChunk { this.x = x; this.z = z; this.minSection = parent.getWorld() != null ? (parent.getWorld().getMinY() >> 4) : 0; - int sections = parent.getWorld() != null ? (parent.getWorld().getMaxY() >> 4) - minSection : 16; + int sections = parent.getWorld() != null ? (parent.getWorld().getMaxY() >> 4) - minSection + 1 : 16; baseblocks = new BaseBlock[sections][]; biomes = new BiomeType[sections][]; } diff --git a/Core/src/main/java/com/plotsquared/core/util/ChunkUtil.java b/Core/src/main/java/com/plotsquared/core/util/ChunkUtil.java index bdaa2a053..7e6f67aab 100644 --- a/Core/src/main/java/com/plotsquared/core/util/ChunkUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/ChunkUtil.java @@ -47,17 +47,14 @@ public class ChunkUtil { x_loc = new short[4096]; y_loc = new short[4096]; z_loc = new short[4096]; - for (int i = 0; i < 16; i++) { - int i4 = i << 4; - for (int j = 0; j < 4096; j++) { - int y = i4 + (j >> 8); - int a = j - ((y & 0xF) << 8); - int z1 = a >> 4; - int x1 = a - (z1 << 4); - x_loc[j] = (short) x1; - y_loc[j] = (short) y; - z_loc[j] = (short) z1; - } + for (int j = 0; j < 4096; j++) { + int y = j >> 8; + int a = j - ((y & 0xF) << 8); + int z1 = a >> 4; + int x1 = a - (z1 << 4); + x_loc[j] = (short) x1; + y_loc[j] = (short) y; + z_loc[j] = (short) z1; } CACHE_J = new short[16][16][16]; for (int x = 0; x < 16; x++) {