/
IStackHelper.java
36 lines (30 loc) · 1.29 KB
/
IStackHelper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mezz.jei.api.helpers;
import javax.annotation.Nullable;
import mezz.jei.api.ingredients.subtypes.UidContext;
import net.minecraft.item.ItemStack;
import mezz.jei.api.ingredients.subtypes.ISubtypeManager;
/**
* Helps get ItemStacks from common formats used in recipes.
* Get the instance from {@link IJeiHelpers#getStackHelper()}.
*/
public interface IStackHelper {
/**
* Similar to ItemStack.areItemStacksEqual but ignores NBT on items without subtypes, and uses the {@link ISubtypeManager}
* @since JEI 7.3.0
*/
boolean isEquivalent(@Nullable ItemStack lhs, @Nullable ItemStack rhs, UidContext context);
/**
* Similar to ItemStack.areItemStacksEqual but ignores NBT on items without subtypes, and uses the {@link ISubtypeManager}
* @deprecated since JEI 7.3.0. Use {@link #isEquivalent(ItemStack, ItemStack, UidContext)}
*/
@Deprecated
default boolean isEquivalent(@Nullable ItemStack lhs, @Nullable ItemStack rhs) {
return isEquivalent(lhs, rhs, UidContext.Ingredient);
}
/**
* Gets the unique identifier for a stack, ignoring NBT on items without subtypes, and uses the {@link ISubtypeManager}.
* If two unique identifiers are equal, then the items can be considered equivalent.
* @since JEI 7.6.1
*/
String getUniqueIdentifierForStack(ItemStack stack, UidContext context);
}