From 4007155b8f0137081afa21ff006f5e19d0ebbf91 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 5 Mar 2017 15:30:21 +1100 Subject: [PATCH] Fix index bounds error --- .../java/com/boydti/fawe/bukkit/v1_11/BukkitQueue_1_11.java | 1 - core/src/main/java/com/boydti/fawe/object/FaweQueue.java | 2 -- .../com/boydti/fawe/object/extent/FastWorldEditExtent.java | 4 ++++ 3 files changed, 4 insertions(+), 3 deletions(-) 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 4771c92b..85a58946 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 @@ -24,7 +24,6 @@ import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.UUID; -import java.util.concurrent.ExecutorCompletionService; import net.minecraft.server.v1_11_R1.BiomeBase; import net.minecraft.server.v1_11_R1.BiomeCache; import net.minecraft.server.v1_11_R1.Block; diff --git a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java index 6a4b83c2..9d841409 100644 --- a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java @@ -28,7 +28,6 @@ import java.util.HashSet; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedDeque; -import java.util.concurrent.ExecutorCompletionService; import javax.annotation.Nullable; public abstract class FaweQueue implements HasFaweQueue { @@ -312,7 +311,6 @@ public abstract class FaweQueue implements HasFaweQueue { @Deprecated public boolean next() { int amount = Settings.IMP.QUEUE.PARALLEL_THREADS; - ExecutorCompletionService service = SetQueue.IMP.getCompleterService(); long time = 20; // 30ms return next(amount, time); } diff --git a/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java b/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java index 2cd5ea2e..0024fb1b 100644 --- a/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java +++ b/core/src/main/java/com/boydti/fawe/object/extent/FastWorldEditExtent.java @@ -10,6 +10,7 @@ import com.sk89q.jnbt.DoubleTag; import com.sk89q.jnbt.ListTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; +import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.WorldEditException; @@ -104,6 +105,9 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa @Override public BaseBlock getLazyBlock(int x, int y, int z) { + if (y > maxY || y < 0) { + return EditSession.nullBlock; + } int combinedId4Data = queue.getCombinedId4Data(x, y, z, 0); int id = FaweCache.getId(combinedId4Data); if (!FaweCache.hasNBT(id)) {