mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 11:05:13 +01:00
SPIGOT-279: Fix all metadata being cleared for items that support blockEntityTag on material mis-match
This commit is contained in:
parent
264d479fd8
commit
306b233a40
2 changed files with 1 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue