From 39d451438f3210cc79e2defa7ba56989c3683511 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 24 Aug 2012 13:38:00 -0700 Subject: [PATCH] Changed EditSession.rawSetBlock() to call setBlock() on World. --- .../java/com/sk89q/worldedit/EditSession.java | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/EditSession.java b/src/main/java/com/sk89q/worldedit/EditSession.java index 48c0181de..ff6d39566 100644 --- a/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/src/main/java/com/sk89q/worldedit/EditSession.java @@ -37,8 +37,6 @@ import com.sk89q.worldedit.bags.UnplaceableBlockException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BlockID; import com.sk89q.worldedit.blocks.BlockType; -import com.sk89q.worldedit.blocks.ContainerBlock; -import com.sk89q.worldedit.blocks.TileEntityBlock; import com.sk89q.worldedit.expression.Expression; import com.sk89q.worldedit.expression.ExpressionException; import com.sk89q.worldedit.expression.runtime.RValue; @@ -222,33 +220,19 @@ public class EditSession { } } } - - final boolean result; - - if (world.usesBlockData(type)) { + + boolean result; + + if (type == 0) { if (fastMode) { - result = world.setTypeIdAndDataFast(pt, type, block.getData() > -1 ? block.getData() : 0); + result = world.setBlockTypeFast(pt, 0); } else { - result = world.setTypeIdAndData(pt, type, block.getData() > -1 ? block.getData() : 0); + result = world.setBlockType(pt, 0); } } else { - if (fastMode) { - result = world.setBlockTypeFast(pt, type); - } else { - result = world.setBlockType(pt, type); - } - } - //System.out.println(pt + "" +result); - - if (type != 0) { - if (block instanceof ContainerBlock) { - if (blockBag == null) { - world.copyToWorld(pt, block); - } - } else if (block instanceof TileEntityBlock) { - world.copyToWorld(pt, block); - } + result = world.setBlock(pt, block, fastMode); } + return result; }