From ba1d2c751b104b8fbd0d207d09e5e87da2a378da Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 17 Mar 2012 15:09:37 -0700 Subject: [PATCH] Fixed FloatingTreeRemover (/tool deltree) to work correctly with jungle trees --- .../com/sk89q/worldedit/tools/FloatingTreeRemover.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java b/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java index 1ab574d8f..0906391c0 100755 --- a/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java +++ b/src/main/java/com/sk89q/worldedit/tools/FloatingTreeRemover.java @@ -29,7 +29,7 @@ import com.sk89q.worldedit.blocks.BlockID; /** * A pickaxe mode that removes floating treetops (logs and leaves not connected * to anything else) - * + * * @author Moo0 */ public class FloatingTreeRemover implements BlockTool { @@ -54,6 +54,7 @@ public class FloatingTreeRemover implements BlockTool { case BlockID.LEAVES: case BlockID.BROWN_MUSHROOM_CAP: case BlockID.RED_MUSHROOM_CAP: + case BlockID.VINE: break; default: @@ -77,6 +78,7 @@ public class FloatingTreeRemover implements BlockTool { case BlockID.LEAVES: case BlockID.BROWN_MUSHROOM_CAP: case BlockID.RED_MUSHROOM_CAP: + case BlockID.VINE: editSession.setBlock(blockVector, AIR); } } @@ -132,13 +134,15 @@ public class FloatingTreeRemover implements BlockTool { case BlockID.LEAVES: case BlockID.BROWN_MUSHROOM_CAP: case BlockID.RED_MUSHROOM_CAP: + case BlockID.VINE: // queue next point queue.addLast(next); break; default: // we hit something solid - evaluate where we came from - if (world.getBlockType(current) == BlockID.LEAVES) { + final int curId = world.getBlockType(current); + if (curId == BlockID.LEAVES || curId == BlockID.VINE) { // leaves touching a wall/the ground => stop walking this route continue; } else {