mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
More work in the quest for greater recipe efficiency.
This commit is contained in:
1 parent
c6a77f9cfa
commit
c7a429177b
87 files changed
+1416
-1106
No files matched your search
@@ -55,6 +55,10 @@ public final class StackUtils
|
||||
|
||||
public static boolean equalsWildcard(ItemStack wild, ItemStack check)
|
||||
{
|
||||
if(wild == null || check == null)
|
||||
{
|
||||
return check == wild;
|
||||
}
|
||||
return wild.getItem() == check.getItem() && (wild.getItemDamage() == OreDictionary.WILDCARD_VALUE || wild.getItemDamage() == check.getItemDamage());
|
||||
}
|
||||
|
||||
@@ -231,6 +235,11 @@ public final class StackUtils
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean contains(ItemStack container, ItemStack contained)
|
||||
{
|
||||
return equalsWildcardWithNBT(contained, container) && container.stackSize >= contained.stackSize;
|
||||
}
|
||||
|
||||
public static int hashItemStack(ItemStack stack)
|
||||
{
|
||||
return Item.getIdFromItem(stack.getItem()) << 8 | stack.getItemDamage();
|
||||
|
||||
Reference in new issue
Block a user