public class StackHelper extends java.lang.Object implements IStackHelper
Modifier and Type | Class and Description |
---|---|
static class |
StackHelper.UidMode |
Constructor and Description |
---|
StackHelper(ISubtypeManager subtypeManager) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRegistryNameForStack(net.minecraft.item.ItemStack stack) |
java.lang.String |
getUniqueIdentifierForStack(net.minecraft.item.ItemStack stack,
UidContext context)
Gets the unique identifier for a stack, ignoring NBT on items without subtypes, and uses the
ISubtypeManager . |
boolean |
isEquivalent(net.minecraft.item.ItemStack lhs,
net.minecraft.item.ItemStack rhs,
UidContext context)
Similar to ItemStack.areItemStacksEqual but ignores NBT on items without subtypes, and uses the
ISubtypeManager |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEquivalent
public StackHelper(ISubtypeManager subtypeManager)
public boolean isEquivalent(@Nullable net.minecraft.item.ItemStack lhs, @Nullable net.minecraft.item.ItemStack rhs, UidContext context)
IStackHelper
ISubtypeManager
isEquivalent
in interface IStackHelper
public java.lang.String getUniqueIdentifierForStack(net.minecraft.item.ItemStack stack, UidContext context)
IStackHelper
ISubtypeManager
.
If two unique identifiers are equal, then the items can be considered equivalent.getUniqueIdentifierForStack
in interface IStackHelper
public java.lang.String getRegistryNameForStack(net.minecraft.item.ItemStack stack)