From fabdf0b08a65d4ef97b2e176d9bd25374e7c6a18 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 6 Apr 2016 03:51:52 +1000 Subject: [PATCH] Fixes #18 --- .../main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java | 3 +++ .../main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9.java | 3 +++ .../main/java/com/boydti/fawe/forge/v1_8/SpongeQueue_1_8.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java index a6c4cd02..56a238cb 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_8/BukkitQueue_1_8.java @@ -257,6 +257,9 @@ public class BukkitQueue_1_8 extends BukkitQueue_0 { @Override public int getCombinedId4Data(int x, int y, int z) { + if (y < 0 || y > 255) { + return 0; + } int cx = x >> 4; int cz = z >> 4; int cy = y >> 4; diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9.java index bb511c4b..d8c1e962 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_9/BukkitQueue_1_9.java @@ -232,6 +232,9 @@ public class BukkitQueue_1_9 extends BukkitQueue_0 { @Override public int getCombinedId4Data(int x, int y, int z) { + if (y < 0 || y > 255) { + return 0; + } try { int cx = x >> 4; int cz = z >> 4; diff --git a/forge/src/main/java/com/boydti/fawe/forge/v1_8/SpongeQueue_1_8.java b/forge/src/main/java/com/boydti/fawe/forge/v1_8/SpongeQueue_1_8.java index 577baa28..11217b53 100644 --- a/forge/src/main/java/com/boydti/fawe/forge/v1_8/SpongeQueue_1_8.java +++ b/forge/src/main/java/com/boydti/fawe/forge/v1_8/SpongeQueue_1_8.java @@ -88,6 +88,9 @@ public class SpongeQueue_1_8 extends SpongeQueue_0 { @Override public int getCombinedId4Data(int x, int y, int z) { + if (y < 0 || y > 255) { + return 0; + } int cx = x >> 4; int cz = z >> 4; int cy = y >> 4;