More work in the quest for greater recipe efficiency.

This commit is contained in:
Ben Spiers committed 2014-09-05 04:20:12 +01:00
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();