fix inventory tick not properly fixing blank slates

This commit is contained in:
yrsegal@gmail.com 2022-04-29 14:05:13 -04:00
parent ad57001c1b
commit f048652503

View file

@ -52,19 +52,15 @@ public class ItemSlate extends BlockItem implements DataHolderItem {
// TODO: what the hell does this do and how to do it on forge
@SoftImplement("forge")
public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) {
var tag = stack.getTagElement("BlockEntityTag");
if (tag != null && tag.isEmpty()) {
if (!hasPattern(stack))
stack.removeTagKey("BlockEntityTag");
}
return false;
}
@Override
public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) {
var tag = pStack.getTagElement("BlockEntityTag");
if (tag != null && tag.isEmpty()) {
if (!hasPattern(pStack))
pStack.removeTagKey("BlockEntityTag");
}
}
@Override