Fix deployer adding empty NBT tag to items ike food or bonemeal if they could not be used

This commit is contained in:
grimmauld 2020-09-05 17:43:02 +02:00
parent fd457c1216
commit a2e4ffbf86

View file

@ -281,8 +281,8 @@ public class DeployerHandler {
ActionResult<ItemStack> onItemRightClick = item.onItemRightClick(itemUseWorld, player, hand); ActionResult<ItemStack> onItemRightClick = item.onItemRightClick(itemUseWorld, player, hand);
player.setHeldItem(hand, onItemRightClick.getResult()); player.setHeldItem(hand, onItemRightClick.getResult());
CompoundNBT tag = stack.getOrCreateTag(); CompoundNBT tag = stack.getTag();
if (stack.getItem() instanceof SandPaperItem && tag.contains("Polishing")) if (tag != null && stack.getItem() instanceof SandPaperItem && tag.contains("Polishing"))
player.spawnedItemEffects = ItemStack.read(tag.getCompound("Polishing")); player.spawnedItemEffects = ItemStack.read(tag.getCompound("Polishing"));
if (!player.getActiveItemStack() if (!player.getActiveItemStack()