From b3e1076868ff6c2721277a5afbd136904516990c Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 14 Apr 2019 14:31:27 +1000 Subject: [PATCH] Fix combine-stages=false for FAVS --- .../fawe/object/ChangeSetFaweQueue.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java b/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java index 9c3974997..41568f4e1 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java @@ -4,7 +4,11 @@ import com.boydti.fawe.FaweCache; import com.boydti.fawe.object.changeset.FaweChangeSet; import com.boydti.fawe.object.queue.DelegateFaweQueue; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; @@ -25,8 +29,28 @@ public class ChangeSetFaweQueue extends DelegateFaweQueue { } @Override - public boolean setBlock(int x, int y, int z, int combinedId) { + public > boolean setBlock(BlockVector3 p, B block) throws WorldEditException { + return setBlock(p.getX(), p.getY(), p.getZ(), block.getInternalId(), block.getNbtData()); + } + @Override + public > boolean setBlock(int x, int y, int z, B block) throws WorldEditException { + return setBlock(x, y, z, block.getInternalId(), block.getNbtData()); + } + + @Override + public boolean setBlock(int x, int y, int z, int combinedId, CompoundTag nbt) { + if (setBlock(x, y, z, combinedId)) { + if (nbt != null) { + set.addTileCreate(nbt); + } + return true; + } + return false; + } + + @Override + public boolean setBlock(int x, int y, int z, int combinedId) { if (super.setBlock(x, y, z, combinedId)) { int combinedFrom = getParent().getCombinedId4Data(x, y, z); BlockType typeFrom = BlockTypes.getFromStateId(combinedFrom);