public class StackHelper extends java.lang.Object implements IStackHelper
| Modifier and Type | Class and Description |
|---|---|
static class |
StackHelper.MatchingItemsResult |
static class |
StackHelper.UidMode |
| Constructor and Description |
|---|
StackHelper() |
| Modifier and Type | Method and Description |
|---|---|
int |
addStack(net.minecraft.inventory.Container container,
java.util.Collection<java.lang.Integer> slotIndexes,
net.minecraft.item.ItemStack stack,
boolean doAdd) |
boolean |
containsSameStacks(java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
java.lang.Iterable<net.minecraft.item.ItemStack> contains)
Returns true if all stacks from "contains" are found in "stacks" and the opposite is true as well.
|
net.minecraft.item.ItemStack |
containsStack(java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
net.minecraft.item.ItemStack contains) |
net.minecraft.item.ItemStack |
containsStack(java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
java.lang.Iterable<net.minecraft.item.ItemStack> contains) |
void |
disableUidCache() |
void |
enableUidCache() |
java.util.List<net.minecraft.item.ItemStack> |
getAllSubtypes(java.lang.Iterable stacks)
Expands an Iterable, which may contain ItemStacks or more Iterables, and
returns all the subtypes of itemStacks if they have wildcard meta value.
|
StackHelper.MatchingItemsResult |
getMatchingItems(java.util.List<net.minecraft.item.ItemStack> availableItemStacks,
java.util.Map<java.lang.Integer,? extends IGuiIngredient<net.minecraft.item.ItemStack>> ingredientsMap)
Returns a list of items in slots that complete the recipe defined by requiredStacksList.
|
java.lang.String |
getModId(net.minecraft.item.Item item) |
java.lang.String |
getModId(net.minecraft.item.ItemStack stack) |
java.lang.String |
getOreDictEquivalent(java.util.Collection<net.minecraft.item.ItemStack> itemStacks) |
net.minecraft.inventory.Slot |
getSlotWithStack(net.minecraft.inventory.Container container,
java.lang.Iterable<java.lang.Integer> slotNumbers,
net.minecraft.item.ItemStack stack) |
java.util.List<net.minecraft.item.ItemStack> |
getSubtypes(net.minecraft.item.Item item,
int stackSize) |
java.util.List<net.minecraft.item.ItemStack> |
getSubtypes(net.minecraft.item.ItemStack itemStack)
Returns all the subtypes of itemStack if it has a wildcard meta value.
|
java.lang.String |
getUniqueIdentifierForStack(net.minecraft.item.ItemStack stack) |
java.lang.String |
getUniqueIdentifierForStack(net.minecraft.item.ItemStack stack,
StackHelper.UidMode mode) |
java.util.List<java.lang.String> |
getUniqueIdentifiersWithWildcard(net.minecraft.item.ItemStack itemStack) |
boolean |
isEquivalent(net.minecraft.item.ItemStack lhs,
net.minecraft.item.ItemStack rhs)
Similar to ItemStack.areItemStacksEqual but ignores NBT on items without subtypes, and uses the INbtIgnoreList
|
java.util.List<net.minecraft.item.ItemStack> |
toItemStackList(java.lang.Object stacks)
Flattens ItemStacks, OreDict Strings, and Iterables into a list of ItemStacks.
|
public void enableUidCache()
public void disableUidCache()
@Nullable
public java.lang.String getOreDictEquivalent(@Nonnull
java.util.Collection<net.minecraft.item.ItemStack> itemStacks)
@Nonnull public StackHelper.MatchingItemsResult getMatchingItems(@Nonnull java.util.List<net.minecraft.item.ItemStack> availableItemStacks, @Nonnull java.util.Map<java.lang.Integer,? extends IGuiIngredient<net.minecraft.item.ItemStack>> ingredientsMap)
@Nullable
public net.minecraft.inventory.Slot getSlotWithStack(@Nonnull
net.minecraft.inventory.Container container,
@Nonnull
java.lang.Iterable<java.lang.Integer> slotNumbers,
@Nonnull
net.minecraft.item.ItemStack stack)
public boolean containsSameStacks(@Nonnull
java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
@Nonnull
java.lang.Iterable<net.minecraft.item.ItemStack> contains)
@Nullable
public net.minecraft.item.ItemStack containsStack(@Nullable
java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
@Nullable
java.lang.Iterable<net.minecraft.item.ItemStack> contains)
@Nullable
public net.minecraft.item.ItemStack containsStack(@Nullable
java.lang.Iterable<net.minecraft.item.ItemStack> stacks,
@Nullable
net.minecraft.item.ItemStack contains)
public boolean isEquivalent(@Nullable
net.minecraft.item.ItemStack lhs,
@Nullable
net.minecraft.item.ItemStack rhs)
@Nonnull
public java.util.List<net.minecraft.item.ItemStack> getSubtypes(@Nullable
net.minecraft.item.ItemStack itemStack)
IStackHelpergetSubtypes in interface IStackHelper@Nonnull
public java.util.List<net.minecraft.item.ItemStack> getSubtypes(@Nonnull
net.minecraft.item.Item item,
int stackSize)
@Nonnull
public java.util.List<net.minecraft.item.ItemStack> getAllSubtypes(@Nullable
java.lang.Iterable stacks)
IStackHelpergetAllSubtypes in interface IStackHelper@Nonnull
public java.util.List<net.minecraft.item.ItemStack> toItemStackList(@Nullable
java.lang.Object stacks)
IStackHelpertoItemStackList in interface IStackHelper@Nonnull
public java.lang.String getModId(@Nonnull
net.minecraft.item.ItemStack stack)
@Nonnull
public java.lang.String getModId(@Nonnull
net.minecraft.item.Item item)
@Nonnull
public java.lang.String getUniqueIdentifierForStack(@Nonnull
net.minecraft.item.ItemStack stack)
@Nonnull
public java.lang.String getUniqueIdentifierForStack(@Nonnull
net.minecraft.item.ItemStack stack,
@Nonnull
StackHelper.UidMode mode)
@Nonnull
public java.util.List<java.lang.String> getUniqueIdentifiersWithWildcard(@Nonnull
net.minecraft.item.ItemStack itemStack)
public int addStack(@Nonnull
net.minecraft.inventory.Container container,
@Nonnull
java.util.Collection<java.lang.Integer> slotIndexes,
@Nonnull
net.minecraft.item.ItemStack stack,
boolean doAdd)