From 9b7b30ac1b435555a85dea540e37fa562859aafe Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 29 Nov 2016 15:20:00 +1100 Subject: [PATCH] Fixes #322 --- .../com/boydti/fawe/bukkit/v1_10/BukkitQueue_1_10.java | 7 ++++--- .../com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java | 7 ++++--- .../java/com/boydti/fawe/bukkit/v1_7/BukkitQueue17.java | 7 ++++--- .../java/com/boydti/fawe/bukkit/v1_8/BukkitQueue18R3.java | 7 ++++--- .../com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9_R1.java | 7 ++++--- core/src/main/java/com/boydti/fawe/FaweVersion.java | 2 +- .../src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java | 7 ++++--- .../main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java | 7 ++++--- .../main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java | 7 ++++--- .../main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java | 7 ++++--- .../main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java | 7 ++++--- .../boydti/fawe/nukkit/optimization/queue/NukkitQueue.java | 7 ++++--- 12 files changed, 45 insertions(+), 34 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_10/BukkitQueue_1_10.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_10/BukkitQueue_1_10.java index 859ec062..3a408e8a 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_10/BukkitQueue_1_10.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_10/BukkitQueue_1_10.java @@ -92,9 +92,10 @@ public class BukkitQueue_1_10 extends BukkitQueue_0 value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } 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 3c0d3d08..8e11d257 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 @@ -92,9 +92,10 @@ public class BukkitQueue_1_11 extends BukkitQueue_0 value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_7/BukkitQueue17.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_7/BukkitQueue17.java index 27ee4a55..eb136fac 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_7/BukkitQueue17.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_7/BukkitQueue17.java @@ -72,9 +72,10 @@ public class BukkitQueue17 extends BukkitQueue_0 value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue18R3.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue18R3.java index 093b4603..cf2ae6fb 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue18R3.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue18R3.java @@ -75,9 +75,10 @@ public class BukkitQueue18R3 extends BukkitQueue_0 value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9_R1.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9_R1.java index 6f6a076d..f1ae6600 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9_R1.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9_R1.java @@ -108,9 +108,10 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0 value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/core/src/main/java/com/boydti/fawe/FaweVersion.java b/core/src/main/java/com/boydti/fawe/FaweVersion.java index cf16e8f7..40292bdd 100644 --- a/core/src/main/java/com/boydti/fawe/FaweVersion.java +++ b/core/src/main/java/com/boydti/fawe/FaweVersion.java @@ -25,4 +25,4 @@ public class FaweVersion { public boolean isNewer(FaweVersion other) { return other.build < this.build && (this.major > other.major || (this.major == other.major && this.minor > other.minor) || (this.major == other.major && this.minor == other.minor && this.patch > other.patch)); } -} +} \ No newline at end of file diff --git a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java index bde26619..aa6c7464 100644 --- a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java +++ b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java @@ -168,9 +168,10 @@ public class MCAQueue extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index 590fd9c4..cfadffd6 100644 --- a/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge110/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -84,9 +84,10 @@ public class ForgeQueue_All extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index 220dc7c2..dd715bff 100644 --- a/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge1710/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -81,9 +81,10 @@ public class ForgeQueue_All extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index fb3fd43b..3491810b 100644 --- a/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge189/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -78,9 +78,10 @@ public class ForgeQueue_All extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java b/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java index 4a5938fc..8f002547 100644 --- a/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java +++ b/forge194/src/main/java/com/boydti/fawe/forge/v0/ForgeQueue_All.java @@ -86,9 +86,10 @@ public class ForgeQueue_All extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } } diff --git a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java index ab2ea81c..5ae3e8db 100644 --- a/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java +++ b/nukkit/src/main/java/com/boydti/fawe/nukkit/optimization/queue/NukkitQueue.java @@ -55,9 +55,10 @@ public class NukkitQueue extends NMSMappedFaweQueue value) { - otherMap[i] = value; + int newHeight = heightMap[i] & 0xFF; + int currentHeight = otherMap[i]; + if (newHeight > currentHeight) { + otherMap[i] = newHeight; } } }