Interface IAdvancedItemHandlerModifiable
- All Superinterfaces:
IAdvancedItemHandler, net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>
- All Known Implementing Classes:
BaseItemStackHandler, StackItemResourceHandler
Rich interface that provides some default methods to an
IAdvancedItemHandler with direct
slot modification support.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclear()Clears all slots from the item handler.default intClears all stacks from the item handler that match a predicate.voidset(int index, net.neoforged.neoforge.transfer.item.ItemResource resource, int amount) Directly sets a slot to the given resource and amount without a transaction.Methods inherited from interface IAdvancedItemHandler
extractItem, extractItem, hasSpaceFor, hasSpaceFor, insertItemMethods inherited from interface net.neoforged.neoforge.transfer.ResourceHandler
extract, extract, getAmountAsInt, getAmountAsLong, getCapacityAsInt, getCapacityAsLong, getResource, insert, insert, isValid, size
-
Method Details
-
set
void set(int index, net.neoforged.neoforge.transfer.item.ItemResource resource, int amount) Directly sets a slot to the given resource and amount without a transaction. -
clear
default void clear()Clears all slots from the item handler. -
clear
Clears all stacks from the item handler that match a predicate.- Returns:
- The amount of items cleared.
-