From 3791cf947ec9dcd7918049a8c23b09e74fca054e Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Jul 2018 09:53:50 +1000 Subject: [PATCH] SPIGOT-4037: Improve legacy BlockState.setData --- .../java/org/bukkit/craftbukkit/block/CraftBlockState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java index 08f73c8f40..9e745e57c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -20,6 +20,7 @@ import org.bukkit.plugin.Plugin; import java.util.List; import net.minecraft.server.GeneratorAccess; import net.minecraft.server.IBlockData; +import org.bukkit.craftbukkit.util.CraftLegacy; public class CraftBlockState implements BlockState { private final CraftWorld world; @@ -101,7 +102,7 @@ public class CraftBlockState implements BlockState { } public void setData(final MaterialData data) { - Material mat = getType(); + Material mat = CraftMagicNumbers.getMaterial(this.data).getItemType(); if ((mat == null) || (mat.getData() == null)) { this.data = CraftMagicNumbers.getBlock(data);