From 34d157aca8feaaa61d23e30e71f5153ad24091d7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 27 Dec 2014 00:51:59 +0000 Subject: [PATCH] SPIGOT-279: Fix all metadata being cleared for items that support blockEntityTag on material mis-match By: Thinkofdeath --- .../org/bukkit/craftbukkit/inventory/CraftItemFactory.java | 7 ------- .../bukkit/craftbukkit/inventory/CraftMetaTileEntity.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index b46d3b5c64..0f89623db2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -103,13 +103,6 @@ public final class CraftItemFactory implements ItemFactory { case HOPPER: case REDSTONE_COMPARATOR: case FLOWER_POT_ITEM: - if (meta instanceof CraftMetaTileEntity) { - CraftMetaTileEntity te = (CraftMetaTileEntity) meta; - if (te.material != material) { - return new CraftMetaTileEntity((CraftMetaTileEntity) null, material); - } - return meta; - } return new CraftMetaTileEntity(meta, material); default: return new CraftMetaItem(meta); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTileEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTileEntity.java index fc293741f4..6718f96e68 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTileEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTileEntity.java @@ -20,7 +20,7 @@ public class CraftMetaTileEntity extends CraftMetaItem { super(meta); this.material = material; - if (!(meta instanceof CraftMetaTileEntity)) { + if (!(meta instanceof CraftMetaTileEntity) || ((CraftMetaTileEntity) meta).material != material) { blockEntityTag = null; return; }