SPIGOT-279: Fix all metadata being cleared for items that support blockEntityTag on material mis-match

This commit is contained in:
Thinkofdeath 2014-12-27 00:51:59 +00:00
parent 264d479fd8
commit 306b233a40
2 changed files with 1 additions and 8 deletions

View file

@ -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);

View file

@ -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;
}