From 31bd786fdf32e7c79569c5eaf315d5b87889f92c Mon Sep 17 00:00:00 2001 From: zml2008 Date: Mon, 16 Jan 2012 16:49:54 -0800 Subject: [PATCH] Fix some piston operations where pistons have their state toggled mid-operation --- .../com/sk89q/worldedit/blocks/BlockType.java | 20 ++++++++++++------- .../scripting/RhinoCraftScriptEngine.java | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index b9922faa7..0efa94b9f 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -320,6 +320,10 @@ public enum BlockType { shouldPlaceLast.add(BlockID.VINE); shouldPlaceLast.add(BlockID.LILY_PAD); shouldPlaceLast.add(BlockID.NETHER_WART); + shouldPlaceLast.add(BlockID.PISTON_BASE); + shouldPlaceLast.add(BlockID.PISTON_STICKY_BASE); + shouldPlaceLast.add(BlockID.PISTON_EXTENSION); + shouldPlaceLast.add(BlockID.PISTON_MOVING_PIECE); } /** @@ -346,13 +350,15 @@ public enum BlockType { */ private static final Set shouldPlaceFinal = new HashSet(); static { - shouldPlaceLast.add(BlockID.SIGN_POST); - shouldPlaceLast.add(BlockID.WOODEN_DOOR); - shouldPlaceLast.add(BlockID.WALL_SIGN); - shouldPlaceLast.add(BlockID.IRON_DOOR); - shouldPlaceLast.add(BlockID.CACTUS); - shouldPlaceLast.add(BlockID.REED); - shouldPlaceLast.add(BlockID.CAKE_BLOCK); + shouldPlaceFinal.add(BlockID.SIGN_POST); + shouldPlaceFinal.add(BlockID.WOODEN_DOOR); + shouldPlaceFinal.add(BlockID.WALL_SIGN); + shouldPlaceFinal.add(BlockID.IRON_DOOR); + shouldPlaceFinal.add(BlockID.CACTUS); + shouldPlaceFinal.add(BlockID.REED); + shouldPlaceFinal.add(BlockID.CAKE_BLOCK); + shouldPlaceFinal.add(BlockID.PISTON_EXTENSION); + shouldPlaceFinal.add(BlockID.PISTON_MOVING_PIECE); } /** diff --git a/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java b/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java index f4d2ea05d..66df455fa 100644 --- a/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java +++ b/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java @@ -61,7 +61,7 @@ public class RhinoCraftScriptEngine implements CraftScriptEngine { if (e instanceof WrappedException) { Throwable cause = ((WrappedException) e).getCause(); if (cause instanceof WorldEditException) { - throw ((WrappedException) e).getCause(); + throw cause; } }