mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Massive recipe system overhaul.
They should be much more efficient now (this reduced the tick time of the CI Chamber by 3-4x in my testing), due to being able to just use the HashMap's get() instead of being limited to iterating through entries. NEI integration code now a lot more readable and type-safe as well.
This commit is contained in:
1 parent
4dd3d4ba01
commit
ce6946c669
77 files changed
+1294
-486
No files matched your search
@@ -58,6 +58,11 @@ public final class StackUtils
|
||||
return wild.getItem() == check.getItem() && (wild.getItemDamage() == OreDictionary.WILDCARD_VALUE || wild.getItemDamage() == check.getItemDamage());
|
||||
}
|
||||
|
||||
public static boolean equalsWildcardWithNBT(ItemStack wild, ItemStack check)
|
||||
{
|
||||
return equalsWildcard(wild, check) && (wild.stackTagCompound == null ? check.stackTagCompound == null : (wild.stackTagCompound == check.stackTagCompound || wild.stackTagCompound.equals(check.stackTagCompound)));
|
||||
}
|
||||
|
||||
public static List<ItemStack> even(ItemStack stack1, ItemStack stack2)
|
||||
{
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
@@ -225,4 +230,9 @@ public final class StackUtils
|
||||
return StackUtils.size(orig, newSize);
|
||||
}
|
||||
}
|
||||
|
||||
public static int hashItemStack(ItemStack stack)
|
||||
{
|
||||
return Item.getIdFromItem(stack.getItem()) << 8 | stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user