first exact search underlying list in oredicted list

This commit is contained in:
way2muchnoise
2016-11-02 19:36:55 +01:00
parent bcbd344469
commit 17366c0cb2

View File

@@ -76,6 +76,9 @@ public class ItemStackListOredicted implements IItemStackList {
@Nullable
@Override
public ItemStack get(@Nonnull ItemStack stack, int flags) {
// Check the underlying list but don't do oredict things for exact match
ItemStack exact = underlyingList.get(stack, flags & ~IComparer.COMPARE_OREDICT);
if (exact == null) {
if ((flags & IComparer.COMPARE_OREDICT) == IComparer.COMPARE_OREDICT) {
int[] ids = OreDictionary.getOreIDs(stack);
for (int id : ids) {
@@ -92,8 +95,8 @@ public class ItemStackListOredicted implements IItemStackList {
}
}
}
// Check the underlying list but don't do oredict things, as that has been tried before
return underlyingList.get(stack, flags & ~IComparer.COMPARE_OREDICT);
}
return exact;
}
@Nullable