Compare commits

..

2 commits

Author SHA1 Message Date
Ell
e725ae0164 1.12.2 2022-03-30 23:01:24 +02:00
Ell
5523623524 Cherry-pick f861c0bbb5
Closes #122
2022-03-30 22:58:08 +02:00
3 changed files with 4 additions and 3 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.12.1'
version = '1.12.2'
group = 'de.ellpeck.prettypipes' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'PrettyPipes'

View file

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

View file

@ -160,7 +160,7 @@ public class ItemTerminalBlockEntity extends BlockEntity implements IPipeConnect
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);
}
var requested = this.requestItemImpl(stack, onItemUnavailable(player, false));