Class ItemStackList
java.lang.Object
com.refinedmods.refinedstorage.apiimpl.util.ItemStackList
- All Implemented Interfaces:
IStackList<net.minecraft.world.item.ItemStack>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStackListResult<net.minecraft.world.item.ItemStack>add(net.minecraft.world.item.ItemStack stack) Adds a stack to the list, will merge it with another stack if it already exists in the list.StackListResult<net.minecraft.world.item.ItemStack>add(net.minecraft.world.item.ItemStack stack, int size) Adds a stack to the list, will merge it with another stack if it already exists in the list.voidclear()Clears the list.IStackList<net.minecraft.world.item.ItemStack>copy()net.minecraft.world.item.ItemStackReturns a stack.net.minecraft.world.item.ItemStackget(net.minecraft.world.item.ItemStack stack, int flags) Returns a stack.intgetCount(net.minecraft.world.item.ItemStack stack, int flags) Returns the amount in this list, based on the stack and the flags.StackListEntry<net.minecraft.world.item.ItemStack>getEntry(net.minecraft.world.item.ItemStack stack, int flags) Returns a stack entry.Collection<StackListEntry<net.minecraft.world.item.ItemStack>>Collection<StackListEntry<net.minecraft.world.item.ItemStack>>getStacks(net.minecraft.world.item.ItemStack stack) booleanisEmpty()StackListResult<net.minecraft.world.item.ItemStack>remove(net.minecraft.world.item.ItemStack stack) Decrements the count of that stack in the list.StackListResult<net.minecraft.world.item.ItemStack>remove(net.minecraft.world.item.ItemStack stack, int size) Decrements the count of that stack in the list.intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.refinedmods.refinedstorage.api.util.IStackList
get, getCount
-
Constructor Details
-
ItemStackList
public ItemStackList() -
ItemStackList
-
-
Method Details
-
add
public StackListResult<net.minecraft.world.item.ItemStack> add(@Nonnull net.minecraft.world.item.ItemStack stack, int size) Description copied from interface:IStackListAdds a stack to the list, will merge it with another stack if it already exists in the list.- Specified by:
addin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stacksize- the size to add- Returns:
- the result
-
add
public StackListResult<net.minecraft.world.item.ItemStack> add(@Nonnull net.minecraft.world.item.ItemStack stack) Description copied from interface:IStackListAdds a stack to the list, will merge it with another stack if it already exists in the list.- Specified by:
addin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stack- Returns:
- the result
-
remove
public StackListResult<net.minecraft.world.item.ItemStack> remove(@Nonnull net.minecraft.world.item.ItemStack stack, int size) Description copied from interface:IStackListDecrements the count of that stack in the list.- Specified by:
removein interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stacksize- the size to remove- Returns:
- the result, or null if the stack wasn't present
-
remove
public StackListResult<net.minecraft.world.item.ItemStack> remove(@Nonnull net.minecraft.world.item.ItemStack stack) Description copied from interface:IStackListDecrements the count of that stack in the list.- Specified by:
removein interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stack- Returns:
- the result, or null if the stack wasn't present
-
getCount
public int getCount(@Nonnull net.minecraft.world.item.ItemStack stack, int flags) Description copied from interface:IStackListReturns the amount in this list, based on the stack and the flags.- Specified by:
getCountin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stackflags- the flags- Returns:
- the count, 0 if not found
-
get
@Nullable public net.minecraft.world.item.ItemStack get(@Nonnull net.minecraft.world.item.ItemStack stack, int flags) Description copied from interface:IStackListReturns a stack.- Specified by:
getin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stack to search forflags- the flags to compare on, seeIComparer- Returns:
- the stack, or null if no stack was found
-
getEntry
@Nullable public StackListEntry<net.minecraft.world.item.ItemStack> getEntry(@Nonnull net.minecraft.world.item.ItemStack stack, int flags) Description copied from interface:IStackListReturns a stack entry.- Specified by:
getEntryin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stack to search forflags- the flags to compare on, seeIComparer- Returns:
- the stack entry, or null if no stack entry was found
-
get
Description copied from interface:IStackListReturns a stack.- Specified by:
getin interfaceIStackList<net.minecraft.world.item.ItemStack>- Parameters:
id- the id of the entry to search for- Returns:
- the stack, or null if no stack was found
-
clear
public void clear()Description copied from interface:IStackListClears the list.- Specified by:
clearin interfaceIStackList<net.minecraft.world.item.ItemStack>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIStackList<net.minecraft.world.item.ItemStack>- Returns:
- true if the list is empty, false otherwise
-
getStacks
- Specified by:
getStacksin interfaceIStackList<net.minecraft.world.item.ItemStack>- Returns:
- a collection of stacks in this list
-
getStacks
@Nonnull public Collection<StackListEntry<net.minecraft.world.item.ItemStack>> getStacks(@Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
getStacksin interfaceIStackList<net.minecraft.world.item.ItemStack>- Returns:
- a collection of stacks matching the given type (ignoring NBT)
-
copy
- Specified by:
copyin interfaceIStackList<net.minecraft.world.item.ItemStack>- Returns:
- a new copy of this list, with the stacks in it copied as well
-
size
public int size()- Specified by:
sizein interfaceIStackList<net.minecraft.world.item.ItemStack>- Returns:
- the amount of elements in this list
-