Fix index bounds error

This commit is contained in:
Jesse Boyd 2017-03-05 15:30:21 +11:00
parent e7e833789a
commit 4007155b8f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ExecutorCompletionService;
import net.minecraft.server.v1_11_R1.BiomeBase; import net.minecraft.server.v1_11_R1.BiomeBase;
import net.minecraft.server.v1_11_R1.BiomeCache; import net.minecraft.server.v1_11_R1.BiomeCache;
import net.minecraft.server.v1_11_R1.Block; import net.minecraft.server.v1_11_R1.Block;

View File

@ -28,7 +28,6 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.ExecutorCompletionService;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public abstract class FaweQueue implements HasFaweQueue { public abstract class FaweQueue implements HasFaweQueue {
@ -312,7 +311,6 @@ public abstract class FaweQueue implements HasFaweQueue {
@Deprecated @Deprecated
public boolean next() { public boolean next() {
int amount = Settings.IMP.QUEUE.PARALLEL_THREADS; int amount = Settings.IMP.QUEUE.PARALLEL_THREADS;
ExecutorCompletionService service = SetQueue.IMP.getCompleterService();
long time = 20; // 30ms long time = 20; // 30ms
return next(amount, time); return next(amount, time);
} }

View File

@ -10,6 +10,7 @@ import com.sk89q.jnbt.DoubleTag;
import com.sk89q.jnbt.ListTag; import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.Vector2D; import com.sk89q.worldedit.Vector2D;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
@ -104,6 +105,9 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
@Override @Override
public BaseBlock getLazyBlock(int x, int y, int z) { 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 combinedId4Data = queue.getCombinedId4Data(x, y, z, 0);
int id = FaweCache.getId(combinedId4Data); int id = FaweCache.getId(combinedId4Data);
if (!FaweCache.hasNBT(id)) { if (!FaweCache.hasNBT(id)) {