diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java index 4883be41..af5fcfd2 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java @@ -157,7 +157,6 @@ public class BukkitQueue_1_11 extends BukkitQueue_0 { getParent().setCount(0, getParent().getNonEmptyBlockCount(section) + nonEmptyBlockCount, section); } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -367,22 +359,6 @@ public class ForgeChunk_All extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } } diff --git a/forge110/src/main/java/com/boydti/fawe/forge/v110/ForgeQueue_All.java b/forge110/src/main/java/com/boydti/fawe/forge/v110/ForgeQueue_All.java index 5ff13f5a..49ca5940 100644 --- a/forge110/src/main/java/com/boydti/fawe/forge/v110/ForgeQueue_All.java +++ b/forge110/src/main/java/com/boydti/fawe/forge/v110/ForgeQueue_All.java @@ -106,6 +106,45 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { for (Map.Entry> chunkEntry : blockMap.entrySet()) { @@ -156,20 +195,6 @@ public class ForgeQueue_All extends NMSMappedFaweQueue { getParent().setCount(0, getParent().getNonEmptyBlockCount(section) + nonEmptyBlockCount, section); } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -386,22 +378,6 @@ public class ForgeChunk_All extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } } diff --git a/forge111/src/main/java/com/boydti/fawe/forge/v111/ForgeQueue_All.java b/forge111/src/main/java/com/boydti/fawe/forge/v111/ForgeQueue_All.java index 2934afe1..1915c82a 100644 --- a/forge111/src/main/java/com/boydti/fawe/forge/v111/ForgeQueue_All.java +++ b/forge111/src/main/java/com/boydti/fawe/forge/v111/ForgeQueue_All.java @@ -121,6 +121,46 @@ public class ForgeQueue_All extends NMSMappedFaweQueue> blockMap, FawePlayer... players) { for (Map.Entry> chunkEntry : blockMap.entrySet()) { @@ -186,20 +226,6 @@ public class ForgeQueue_All extends NMSMappedFaweQueue { } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -336,22 +328,6 @@ public class ForgeChunk_All extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } diff --git a/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeQueue_All.java b/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeQueue_All.java index 8faf47f5..8a81b54d 100644 --- a/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeQueue_All.java +++ b/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeQueue_All.java @@ -116,31 +116,42 @@ public class ForgeQueue_All extends NMSMappedFaweQueue { } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -282,22 +274,6 @@ public class ForgeChunk_All extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } } diff --git a/forge189/src/main/java/com/boydti/fawe/forge/v189/ForgeQueue_All.java b/forge189/src/main/java/com/boydti/fawe/forge/v189/ForgeQueue_All.java index e3bb5fa4..df9bff6a 100644 --- a/forge189/src/main/java/com/boydti/fawe/forge/v189/ForgeQueue_All.java +++ b/forge189/src/main/java/com/boydti/fawe/forge/v189/ForgeQueue_All.java @@ -84,6 +84,45 @@ public class ForgeQueue_All extends NMSMappedFaweQueue 15 || z < 0 || z > 15) { return 1; diff --git a/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeChunk_All.java b/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeChunk_All.java index 6e33c862..d5a6fbbb 100644 --- a/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeChunk_All.java +++ b/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeChunk_All.java @@ -327,19 +327,11 @@ public class ForgeChunk_All extends CharFaweChunk { getParent().setCount(0, getParent().getNonEmptyBlockCount(section) + nonEmptyBlockCount, section); } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -365,22 +357,6 @@ public class ForgeChunk_All extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } } diff --git a/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeQueue_All.java b/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeQueue_All.java index a36fd2ec..30331cc0 100644 --- a/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeQueue_All.java +++ b/forge194/src/main/java/com/boydti/fawe/forge/v194/ForgeQueue_All.java @@ -91,6 +91,45 @@ public class ForgeQueue_All extends NMSMappedFaweQueue { getParent().setCount(0, getParent().getNonEmptyBlockCount(section) + nonEmptyBlockCount, section); } // Set biomes - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; + if (this.biomes != null) { + byte[] currentBiomes = nmsChunk.getBiomeArray(); + for (int i = 0 ; i < this.biomes.length; i++) { + if (this.biomes[i] != 0) { + currentBiomes[i] = this.biomes[i]; } } } @@ -401,22 +393,6 @@ public class SpongeChunk_1_11 extends CharFaweChunk { } catch (Throwable e) { MainUtil.handleError(e); } - int[][] biomes = this.biomes; - if (biomes != null) { - for (int x = 0; x < 16; x++) { - int[] array = biomes[x]; - if (array == null) { - continue; - } - for (int z = 0; z < 16; z++) { - int biome = array[z]; - if (biome == 0) { - continue; - } - nmsChunk.getBiomeArray()[((z & 0xF) << 4 | x & 0xF)] = (byte) biome; - } - } - } return this; } } diff --git a/sponge/src/main/java/com/boydti/fawe/sponge/v1_11/SpongeQueue_1_11.java b/sponge/src/main/java/com/boydti/fawe/sponge/v1_11/SpongeQueue_1_11.java index 3cd2e59d..75b024a2 100644 --- a/sponge/src/main/java/com/boydti/fawe/sponge/v1_11/SpongeQueue_1_11.java +++ b/sponge/src/main/java/com/boydti/fawe/sponge/v1_11/SpongeQueue_1_11.java @@ -155,6 +155,45 @@ public class SpongeQueue_1_11 extends NMSMappedFaweQueue[] entities = nmsChunk.getEntityLists(); for (int i = 0; i < entities.length; i++) {