diff --git a/src/main/java/de/ellpeck/prettypipes/packets/PacketRequest.java b/src/main/java/de/ellpeck/prettypipes/packets/PacketRequest.java index 0345fdb..4eeede9 100644 --- a/src/main/java/de/ellpeck/prettypipes/packets/PacketRequest.java +++ b/src/main/java/de/ellpeck/prettypipes/packets/PacketRequest.java @@ -20,7 +20,8 @@ public class PacketRequest { public PacketRequest(BlockPos pos, ItemStack stack, int amount) { this.pos = pos; this.stack = stack; - this.nbtHash = stack.getTag().hashCode(); + if (stack.hasTag()) + this.nbtHash = stack.getTag().hashCode(); this.amount = amount; } diff --git a/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java b/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java index f85c264..d7aaa23 100644 --- a/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java +++ b/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java @@ -163,7 +163,7 @@ public class ItemTerminalTileEntity extends TileEntity implements INamedContaine stack = this.networkItems.values().stream() .map(NetworkItem::asStack) // don't compare with nbt equality here or the whole hashing thing is pointless - .filter(s -> ItemEquality.compareItems(s, filter) && s.getTag().hashCode() == nbtHash) + .filter(s -> ItemEquality.compareItems(s, filter) && s.hasTag() && s.getTag().hashCode() == nbtHash) .findFirst().orElse(filter); } int requested = this.requestItemImpl(stack, onItemUnavailable(player, false));