Interface AbstractInventory<T,I>


public interface AbstractInventory<T,I>
  • Method Details

    • inventory

      Used to get the platform's inventory object.
      Returns:
      The platform's inventory object.
    • canFit

      boolean canFit(AbstractItemStack<I> item)
    • addItem

      Used to add an item to the inventory.
      Parameters:
      item - The item to add to the inventory.
      drop - If the leftover items that won't fit in the inventory should be dropped or not.
      Returns:
      If drop is set to true this is an empty optional, or if drop is false then this is an optional containing the leftover items that wouldn't fit into the inventory.
    • setSlot

      Optional<AbstractItemStack<I>> setSlot(int slot, AbstractItemStack<I> item, boolean drop)
      Used to set a specific slot as a specific item.
      Parameters:
      slot - The slot number to set the item in.
      item - The item to set the slot as.
      drop - If this is true if there is an item in the slot already it is dropped.
      Returns:
      If drop is set to true this is an empty optional, or if drop is false then this is an optional containing the item that was in the slot before if applicable.