diff --git a/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java b/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java index 937e47c7..95da4fac 100644 --- a/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java +++ b/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java @@ -56,36 +56,36 @@ public class HistoryExtent extends AbstractDelegateExtent { @Override public boolean setBlock(int x, int y, int z, BaseBlock block) throws WorldEditException { - if (y > 255 || y < 0) { - return false; - } - int combined = queue.getCombinedId4DataDebug(x, y, z, 0, session); - int id = (combined >> 4); - if (id == block.getId()) { - if (!FaweCache.hasData(id)) { - return false; + if (extent.setBlock(x, y, z, block)) { + int combined = queue.getCombinedId4DataDebug(x, y, z, 0, session); + int id = (combined >> 4); + if (id == block.getId()) { + if (!FaweCache.hasData(id)) { + return false; + } + int data = combined & 0xF; + if (data == block.getData()) { + return false; + } } - int data = combined & 0xF; - if (data == block.getData()) { - return false; - } - } - if (!FaweCache.hasNBT(id)) { - if (FaweCache.hasNBT(block.getId())) { - this.changeSet.add(x, y, z, combined, block); + if (!FaweCache.hasNBT(id)) { + if (FaweCache.hasNBT(block.getId())) { + this.changeSet.add(x, y, z, combined, block); + } else { + this.changeSet.add(x, y, z, combined, (block.getId() << 4) + block.getData()); + } } else { - this.changeSet.add(x, y, z, combined, (block.getId() << 4) + block.getData()); - } - } else { - try { - CompoundTag tag = queue.getTileEntity(x, y, z); - this.changeSet.add(x, y, z, new BaseBlock(id, combined & 0xF, tag), block); - } catch (Throwable e) { - e.printStackTrace(); - this.changeSet.add(x, y, z, combined, block); + try { + CompoundTag tag = queue.getTileEntity(x, y, z); + this.changeSet.add(x, y, z, new BaseBlock(id, combined & 0xF, tag), block); + } catch (Throwable e) { + e.printStackTrace(); + this.changeSet.add(x, y, z, combined, block); + } } + return true; } - return extent.setBlock(x, y, z, block); + return false; } @Override