mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-25 14:34:54 +00:00
Add a way to compare NBT leniently (#209)
* Fix itemstack comparator not handling NBT leniently * add util function to PositionedStack
This commit is contained in:
1 parent
3291dab52d
commit
6609911d96
4 files changed
+101
-2
No files matched your search
@@ -49,14 +49,14 @@ public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
return catalystInfoList.stream().anyMatch(c -> NEIServerUtils.areStacksSameType(c.getStack(), stack));
|
||||
return catalystInfoList.stream().anyMatch(c -> NEIServerUtils.areStacksSameTypeCraftingWithNBT(c.getStack(), stack));
|
||||
}
|
||||
|
||||
public boolean remove(ItemStack stack) {
|
||||
Iterator<CatalystInfo> iter = catalystInfoList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
ItemStack next = iter.next().getStack();
|
||||
if (NEIServerUtils.areStacksSameType(next, stack)) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(next, stack)) {
|
||||
iter.remove();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user