From e2ab87cc073e7d2f52573902566747451d0c4cf1 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 3 Jul 2020 16:45:28 +0100 Subject: [PATCH] lazy //deform AIOOB fix. Fixes #495 --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index f309f27a3..6905ce17f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -2506,8 +2506,15 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { int yv = (int) (y.getValue() * unit.getY() + zero2.getY()); int zv = (int) (z.getValue() * unit.getZ() + zero2.getZ()); + BlockState get; + if (yv >= 0 && yv < 265) { + get = getBlock(xv, yv, zv); + } else { + get = BlockTypes.AIR.getDefaultState(); + } + // read block from world - return setBlock(position, getBlock(xv, yv, zv)); + return setBlock(position, get); } catch (EvaluationException e) { throw new RuntimeException(e); }