Interface IAdvancedItemHandlerModifiable

All Superinterfaces:
IAdvancedItemHandler, net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>
All Known Implementing Classes:
BaseItemStackHandler, StackItemResourceHandler

public interface IAdvancedItemHandlerModifiable extends IAdvancedItemHandler
Rich interface that provides some default methods to an IAdvancedItemHandler with direct slot modification support.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Clears all slots from the item handler.
    default int
    clear(Predicate<net.minecraft.world.item.ItemStack> predicate)
    Clears all stacks from the item handler that match a predicate.
    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.

    Methods 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

      default int clear(Predicate<net.minecraft.world.item.ItemStack> predicate)
      Clears all stacks from the item handler that match a predicate.
      Returns:
      The amount of items cleared.