From 341da0730b233e1e65d55435df0a2a6ad0246cc6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jun 2016 20:16:48 +1000 Subject: [PATCH] SPIGOT-611: Improve setBlock for tile->tile transitions --- src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index cdeff9bc39..a5d6f1d2d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -135,6 +135,10 @@ public class CraftBlock implements Block { public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) { IBlockData blockData = getNMSBlock(type).fromLegacyData(data); BlockPosition position = new BlockPosition(x, y, z); + + // SPIGOT-611: need to do this to prevent glitchiness. Easier to handle this here (like /setblock) than to fix weirdness in tile entity cleanup + chunk.getHandle().getWorld().setTypeAndData(position, Blocks.AIR.getBlockData(), 0); + if (applyPhysics) { return chunk.getHandle().getWorld().setTypeAndData(position, blockData, 3); } else {