From 7cf7c0712f5590b19ec4a3c4effa0d5b20e4fb45 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 13 Oct 2018 19:50:13 +1100 Subject: [PATCH] fix fixwater/lava + tile paste --- .../boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java | 4 ++-- .../src/main/java/com/sk89q/worldedit/EditSession.java | 4 ++-- .../java/com/sk89q/worldedit/command/UtilityCommands.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java index 4ca62424e..10eda3100 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java @@ -252,11 +252,11 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit existing = section.getType(x & 15, y & 15, z & 15); } BlockPosition pos = null; - if (existing instanceof TileEntityBlock || blockData instanceof TileEntityBlock) { + CompoundTag nativeTag = state.getNbtData(); + if (nativeTag != null || existing instanceof TileEntityBlock) { pos = new BlockPosition(x, y, z); nmsWorld.setTypeAndData(pos, blockData, 0); // remove tile - CompoundTag nativeTag = state.getNbtData(); if (nativeTag != null) { // We will assume that the tile entity was created for us, // though we do not do this on the Forge version diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 1f1417af6..c14ff2337 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -2010,7 +2010,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - public int fixLiquid(final Vector origin, final double radius, Mask liquidMask) { + public int fixLiquid(final Vector origin, final double radius, Mask liquidMask, Pattern pattern) { checkNotNull(origin); checkArgument(radius >= 0, "radius >= 0 required"); @@ -2020,7 +2020,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))), liquidMask); - BlockReplace replace = new BlockReplace(this, BlockTypes.AIR.getDefaultState()); + BlockReplace replace = new BlockReplace(this, pattern); NonRisingVisitor visitor = new NonRisingVisitor(mask, replace, (int) (radius * 2 + 1), this); // Around the origin in a 3x3 block diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index fa52cc05a..b4caa5208 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -305,7 +305,7 @@ public class UtilityCommands extends MethodCommands { public void fixLava(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException { worldEdit.checkMaxRadius(radius); int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.LAVA.toMask(editSession)); + session.getPlacementPosition(player), radius, BlockTypes.LAVA.toMask(editSession), BlockTypes.LAVA.getDefaultState()); player.print(BBC.getPrefix() + affected + " block(s) have been changed."); } @@ -321,7 +321,7 @@ public class UtilityCommands extends MethodCommands { public void fixWater(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException { worldEdit.checkMaxRadius(radius); int affected = editSession.fixLiquid( - session.getPlacementPosition(player), radius, BlockTypes.WATER.toMask(editSession)); + session.getPlacementPosition(player), radius, BlockTypes.WATER.toMask(editSession), BlockTypes.WATER.getDefaultState()); player.print(BBC.getPrefix() + affected + " block(s) have been changed."); }