Package org.moddingx.libx.inventory
Interface IAdvancedItemHandler
- All Superinterfaces:
net.minecraftforge.items.IItemHandler
- All Known Subinterfaces:
IAdvancedItemHandlerModifiable
- All Known Implementing Classes:
BaseItemStackHandler
public interface IAdvancedItemHandler
extends net.minecraftforge.items.IItemHandler
Rich interface that provides some default methods to an
IItemHandler
.
Just implement this together with IItemHandler
.
If you have an IItemHandlerModifiable
, use IAdvancedItemHandlerModifiable
instead.-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.world.item.ItemStack
extractItem
(int amount, boolean simulate) Works likeIItemHandler.extractItem(int, int, boolean)
but without a specific slot.default net.minecraft.world.item.ItemStack
extractItem
(Predicate<net.minecraft.world.item.ItemStack> predicate, int amount, boolean simulate) Works likeIItemHandler.extractItem(int, int, boolean)
but with a predicate instead of a slot.default boolean
hasSpaceFor
(List<net.minecraft.world.item.ItemStack> stacks) Gets whether the item handler has space for all the items given.default boolean
hasSpaceFor
(List<net.minecraft.world.item.ItemStack> stacks, int startInclusive, int endExclusive) Gets whether the item handler has space for all the items given.default net.minecraft.world.item.ItemStack
insertItem
(net.minecraft.world.item.ItemStack stack, boolean simulate) Works likeIItemHandler.insertItem(int, ItemStack, boolean)
but without a specific slot.static IAdvancedItemHandler
wrap
(net.minecraftforge.items.IItemHandler handler) Creates a new IAdvancedItemHandler from anIItemHandler
.Methods inherited from interface net.minecraftforge.items.IItemHandler
extractItem, getSlotLimit, getSlots, getStackInSlot, insertItem, isItemValid
-
Method Details
-
insertItem
default net.minecraft.world.item.ItemStack insertItem(net.minecraft.world.item.ItemStack stack, boolean simulate) Works likeIItemHandler.insertItem(int, ItemStack, boolean)
but without a specific slot. -
hasSpaceFor
Gets whether the item handler has space for all the items given. This does not check whether the item handler can take the stacks viaIItemHandler.insertItem(int, ItemStack, boolean)
. However it checks forIItemHandler.isItemValid(int, ItemStack)
. -
hasSpaceFor
default boolean hasSpaceFor(List<net.minecraft.world.item.ItemStack> stacks, int startInclusive, int endExclusive) Gets whether the item handler has space for all the items given. This does not check whether the item handler can take the stacks viaIItemHandler.insertItem(int, ItemStack, boolean)
. However it checks forIItemHandler.isItemValid(int, ItemStack)
.- Parameters:
startInclusive
- The first slot to test.endExclusive
- The first slot to after the range of slots to test.
-
extractItem
default net.minecraft.world.item.ItemStack extractItem(int amount, boolean simulate) Works likeIItemHandler.extractItem(int, int, boolean)
but without a specific slot. -
extractItem
default net.minecraft.world.item.ItemStack extractItem(Predicate<net.minecraft.world.item.ItemStack> predicate, int amount, boolean simulate) Works likeIItemHandler.extractItem(int, int, boolean)
but with a predicate instead of a slot. -
wrap
Creates a new IAdvancedItemHandler from anIItemHandler
.
-