From 302e493538dc1111be378baa4101b42248214ca8 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 31 Mar 2014 20:32:56 -0700 Subject: [PATCH] Fixed BlockBagExtent using getBlockType/Data() --- .../java/com/sk89q/worldedit/extent/BlockBagExtent.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/extent/BlockBagExtent.java b/src/main/java/com/sk89q/worldedit/extent/BlockBagExtent.java index 3e6122957..0255a9faf 100644 --- a/src/main/java/com/sk89q/worldedit/extent/BlockBagExtent.java +++ b/src/main/java/com/sk89q/worldedit/extent/BlockBagExtent.java @@ -87,10 +87,11 @@ public class BlockBagExtent extends ExtentDelegate { } @Override - public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException { + public boolean setBlock(Vector position, BaseBlock block) throws WorldEditException { if (blockBag != null) { + BaseBlock lazyBlock = getExtent().getLazyBlock(position); + int existing = lazyBlock.getType(); final int type = block.getType(); - final int existing = world.getBlockType(location); if (type > 0) { try { @@ -109,12 +110,12 @@ public class BlockBagExtent extends ExtentDelegate { if (existing > 0) { try { - blockBag.storeDroppedBlock(existing, world.getBlockData(location)); + blockBag.storeDroppedBlock(existing, lazyBlock.getData()); } catch (BlockBagException ignored) { } } } - return super.setBlock(location, block); + return super.setBlock(position, block); } }