Interface FilteringSlot

All Superinterfaces:
Inventory, Slot, ValueContainer
All Known Subinterfaces:
EquipmentSlot, FuelSlot, InputSlot, PotionSlot

public interface FilteringSlot extends Slot
An inventory slot which can only accept certain types of item.
  • Method Details

    • isValidItem

      boolean isValidItem(ItemStackLike stack)
      Check whether the supplied item can be inserted into this slot. Returning false from this method implies that Inventory.offer(ItemStackLike...) would always return false for this item.
      Parameters:
      stack - ItemStackLike to check
      Returns:
      true if the stack is valid for this slot
    • isValidItem

      boolean isValidItem(ItemType type)
      Check whether the supplied item can be inserted into this slot. Returning false from this method implies that Inventory.offer(ItemStackLike...) would always return false for items of this type.
      Parameters:
      type - ItemType to check
      Returns:
      true if the item type is valid for this slot