diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java index 61b37f516c..ffbe9b3958 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -660,6 +660,23 @@ public class CraftBlockData implements BlockData { this.state = state.mirror(EnumBlockMirror.valueOf(mirror.name())); } + @Override + public void copyTo(BlockData blockData) { + CraftBlockData other = (CraftBlockData) blockData; + IBlockData nms = other.state; + for (IBlockState property : state.getBlock().getStateDefinition().getProperties()) { + if (nms.hasProperty(property)) { + nms = copyProperty(state, nms, property); + } + } + + other.state = nms; + } + + private > IBlockData copyProperty(IBlockData source, IBlockData target, IBlockState property) { + return target.setValue(property, source.getValue(property)); + } + @NotNull @Override public BlockState createBlockState() {