Closes #122
This commit is contained in:
Ell 2022-03-30 22:58:08 +02:00
parent 41bf05a17e
commit 5523623524
2 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,8 @@ public class PacketRequest {
public PacketRequest(BlockPos pos, ItemStack stack, int amount) { public PacketRequest(BlockPos pos, ItemStack stack, int amount) {
this.pos = pos; this.pos = pos;
this.stack = stack; this.stack = stack;
this.nbtHash = stack.getTag().hashCode(); if (stack.hasTag())
this.nbtHash = stack.getTag().hashCode();
this.amount = amount; this.amount = amount;
} }

View file

@ -160,7 +160,7 @@ public class ItemTerminalBlockEntity extends BlockEntity implements IPipeConnect
stack = this.networkItems.values().stream() stack = this.networkItems.values().stream()
.map(NetworkItem::asStack) .map(NetworkItem::asStack)
// don't compare with nbt equality here or the whole hashing thing is pointless // 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); .findFirst().orElse(filter);
} }
var requested = this.requestItemImpl(stack, onItemUnavailable(player, false)); var requested = this.requestItemImpl(stack, onItemUnavailable(player, false));