From d5005a04e3c1f14505117f1173cdb1c43123f3fa Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 16 Dec 2020 19:08:00 +0000 Subject: [PATCH] Return air if attempt to retrieve block from outside range Fixes #682 --- .../com/boydti/fawe/beta/implementation/blocks/CharBlocks.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java index c62207a1a..52ddbb1e7 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/blocks/CharBlocks.java @@ -115,6 +115,9 @@ public abstract class CharBlocks implements IBlocks { public char get(int x, @Range(from = 0, to = 255) int y, int z) { final int layer = y >> 4; final int index = (y & 15) << 8 | z << 4 | x; + if (layer >= sections.length || layer < 0) { + return 0; + } return sections[layer].get(this, layer, index); }