From 7a6a0f68fe118837a1fb0ae0e95c201d38fdea90 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 30 Sep 2021 13:16:15 +0100 Subject: [PATCH] Don't allow area pickaxe outside max y #1331 --- .../java/com/sk89q/worldedit/command/tool/AreaPickaxe.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index 3aa99e678..347605193 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -64,10 +64,11 @@ public class AreaPickaxe implements BlockTool { try (EditSession editSession = session.createEditSession(player, "AreaPickaxe")) { editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); + int maxY = editSession.getMaxY(); try { for (int x = ox - range; x <= ox + range; ++x) { - for (int y = oy - range; y <= oy + range; ++y) { + for (int y = oy - range; y <= oy + range && y <= maxY; ++y) { for (int z = oz - range; z <= oz + range; ++z) { if (!initialType.equals(editSession.getBlock(x, y, z).getBlockType())) { continue;