Class InventoryContents

java.lang.Object
io.github.rysefoxx.inventory.plugin.content.InventoryContents

public class InventoryContents extends Object
Since:
2/17/2022
  • Constructor Summary

    Constructors
    Constructor
    Description
    InventoryContents(@NotNull org.bukkit.entity.Player player, @NotNull RyseInventory inventory, @NotNull org.bukkit.plugin.Plugin plugin)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(@NotNull IntelligentItem item)
    Adds an item to the inventory in the first free place.
    boolean
    add(@NotNull IntelligentType type, org.bukkit.inventory.ItemStack @NotNull ... items)
    Adds an item to the inventory in the first free place.
    boolean
    add(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Adds an item to the inventory in the first free place.
    boolean
    add(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Adds an item to the inventory in the first free place.
    boolean
    add(IntelligentItem @NotNull ... items)
    Add multiple items to the inventory in the first free place.
    boolean
    add(org.bukkit.inventory.ItemStack @NotNull ... items)
    Add multiple items to the inventory in the first free place.
    void
    addAdvancedSlot(int slot, @NotNull Consumer<org.bukkit.event.inventory.InventoryClickEvent> event)
    In this slot items can be taken or added by the player.
    boolean
    addIgnoredSlot(int slot)
    Adds the specified slot to the list of ignored slots
    boolean
    addIgnoredSlots(int @NotNull ... slots)
    Adds all slots to the list of ignored slots
    void
    Removes all properties in the inventory.
    void
    clearProperties(@NotNull BiConsumer<List<String>,@NotNull List<Object>> consumer)
     
    void
    clearProperties(@NotNull Consumer<List<Object>> consumer)
     
     
    void
    fill(@NotNull IntelligentItem item)
    Fills the whole inventory with an ItemStack.
    void
    fill(@NotNull org.bukkit.inventory.ItemStack item)
    Fills the whole inventory with an ItemStack.
    void
    fill(@NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Fills the whole inventory with an ItemStack.
    void
    fillAligned(@NotNull Alignment alignment, int howMuch, @NotNull IntelligentItem item)
    It fills a certain amount of rows or columns with a certain item, depending on the alignment
    void
    fillAligned(@NotNull Alignment alignment, int howMuch, @NotNull org.bukkit.inventory.ItemStack item)
    It fills a certain amount of rows or columns with a certain item, depending on the alignment
    void
    fillAligned(@NotNull Alignment alignment, int howMuch, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    It fills a certain amount of rows or columns with a certain item, depending on the alignment
    void
    fillArea(int areaStart, int areaStop, @NotNull IntelligentItem item)
    Specify the area in which items should be filled.
    void
    fillArea(int areaStart, int areaStop, @NotNull org.bukkit.inventory.ItemStack item)
    Specify the area in which items should be filled.
    void
    fillArea(int areaStart, int areaStop, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Specify the area in which items should be filled.
    void
    Fills the Border with a intelligent ItemStack regardless of inventory size.
    void
    fillBorders(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Fills the Border with a ItemStack regardless of inventory size.
    void
    fillBorders(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Fills the Border with a ItemStack regardless of inventory size.
    void
    fillColumn(int slot, int page, @NotNull IntelligentItem item)
    Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
    void
    fillColumn(int slot, int page, @NotNull IntelligentType type, @NotNull org.bukkit.inventory.ItemStack item)
    Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
    void
    fillColumn(int slot, int page, @NotNull org.bukkit.inventory.ItemStack item)
    Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
    void
    fillColumn(int slot, @NotNull IntelligentItem item)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillColumn(int slot, @NotNull IntelligentItem item, @NotNull BiConsumer<Integer,@NotNull IntelligentItem> appliedTo)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillColumn(int slot, @NotNull org.bukkit.inventory.ItemStack item)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillColumn(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillColumn(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type, @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillColumn(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo)
    Starting at the slot, all the way down the item is placed in the same column.
    void
    fillDiagonal(int startSlot, @NotNull IntelligentItem item)
    Fills the inventory diagonally based on the slot.
    void
    fillDiagonal(int startSlot, @NotNull org.bukkit.inventory.ItemStack item)
    Fills the inventory diagonally based on the slot.
    void
    fillDiagonal(int startSlot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Fills the inventory diagonally based on the slot.
    void
    fillEmpty(@NotNull IntelligentItem item)
    Fills all empty slots within the inventory
    void
    fillEmpty(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Fills all empty slots within the inventory
    void
    fillEmpty(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Fills all empty slots within the inventory
    void
    fillEmptyPage(int page, @NotNull IntelligentItem item)
    Fills all empty slots on a given page.
    void
    fillEmptyPage(int page, @NotNull org.bukkit.inventory.ItemStack item)
    Fills all empty slots on a given page.
    void
    fillEmptyPage(int page, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Fills all empty slots on a given page.
    void
    fillPage(int page, @NotNull IntelligentItem item)
    Fills a single page completely.
    void
    fillPage(int page, @NotNull org.bukkit.inventory.ItemStack item)
    Fills a single page completely.
    void
    fillPage(int page, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Fills a single page completely.
    void
    fillRow(int slot, int page, @NotNull IntelligentItem item)
    Fills a row in the specified page.
    void
    fillRow(int slot, int page, @NotNull IntelligentType type, @NotNull org.bukkit.inventory.ItemStack item)
    Fills a row in the specified page.
    void
    fillRow(int slot, int page, @NotNull org.bukkit.inventory.ItemStack item)
    Fills a row in the specified page.
    void
    fillRow(int slot, @NotNull IntelligentItem item)
    Starting at the slot, the row is completely filled from left to right.
    void
    fillRow(int slot, @NotNull IntelligentItem item, @NotNull BiConsumer<Integer,@NotNull IntelligentItem> appliedTo)
    Starting at the slot, the row is completely filled from left to right.
    void
    fillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item)
    Starting at the slot, the row is completely filled from left to right.
    void
    fillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type)
    Starting at the slot, the row is completely filled from left to right.
    void
    fillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type, @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo)
    Starting at the slot, the row is completely filled from left to right.
    void
    fillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo)
    Starting at the slot, the row is completely filled from left to right.
    int
    findCorner(@NotNull CornerType type)
    Finds the corners of the inventory.
    findInArea(int areaStart, int areaStop)
    Get multiple Intelligent ItemStacks within the specified range.
    int
    findLeftBorder(int startSlot)
    Finds the left border based on the start slot and returns it.
    int
    findLeftBorder(int row, int column)
    Finds the left border based on the start slot and returns it.
    int
    findRightBorder(int startSlot)
    Finds the right border based on the start slot and returns it.
    int
    findRightBorder(int row, int column)
    Finds the right border based on the start slot and returns it.
    @NotNull Optional<Integer>
     
    @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem>
    firstEqual(@NotNull IntelligentItem intelligentItem)
    Find the first item in the current page that matches the given Intelligentitem, and return the slot and item.
    @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem>
    firstEqual(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Find the first item in the current page that matches the given itemStack, and return the slot and item.
    @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem>
    firstEqual(@NotNull org.bukkit.Material material)
    Find the first item in the current page that matches the given material, and return the slot and item.
    get(int slot)
    Fetches a intelligent ItemStack based on the slot.
    get(int row, int column)
    Get a intelligent ItemStack based on the row and column.
    get(@NotNull List<Integer> slots)
    Get all intelligent ItemStacks.
     
    @NotNull Optional<org.apache.commons.lang3.tuple.Pair<Integer,Integer>>
    getCoordinationOfItem(@NotNull IntelligentItem intelligentItem)
    Preserve the position of the item in the inventory.
    @NotNull Optional<org.apache.commons.lang3.tuple.Pair<Integer,Integer>>
    getCoordinationOfItem(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Preserve the position of the item in the inventory.
     
    getDataFromPage(int page)
     
    getInPage(int pageNumber, int slot)
    Returns the item in the specified slot on the specified page, or null if there is no item in that slot.
    getOrAdd(int row, int column, @NotNull IntelligentItem itemToAdd)
    Get the item inside the slot.
    getOrAdd(int slot, @NotNull IntelligentItem itemToAdd)
    Get the item inside the slot.
    getOrSet(int row, int column, @NotNull IntelligentItem itemToSet)
    Get the item inside the slot.
    getOrSet(int slot, @NotNull IntelligentItem itemToSet)
    Get the item inside the slot.
    @NotNull Optional<Integer>
    getPositionOfItem(@NotNull IntelligentItem intelligentItem)
    Preserve the position of the item in the inventory.
    @NotNull Optional<Integer>
    getPositionOfItem(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Preserve the position of the item in the inventory.
    getPresent(int slot)
    Fetches a intelligent ItemStack based on the slot.
    <T> T
    getProperty(@NotNull String key)
    Method to get property in the content
    <T> T
    getProperty(@NotNull String key, @NotNull Object defaultValue)
    Method to get property in the content
    getWithinPage(int slot, int page)
     
    getWithinPage(int row, int column, int page)
     
    boolean
    hasPropertyKey(@NotNull String key)
    Return true if the key exists
    boolean
    hasPropertyValue(@NotNull Object value)
    Return true if the value exists
    boolean
    hasSlot(int slot)
    With this method you can see if a slot exists in the inventory.
    boolean
    hasSlot(int row, int column)
    With this method you can see if a slot exists in the inventory.
    boolean
    isBottom(int slot)
     
    boolean
    isBottom(int row, int column)
     
    boolean
    isCorner(int slot)
     
    boolean
    isCorner(int row, int column)
     
    boolean
    isIgnoredSlot(int slot)
     
    boolean
    isLeftBorder(int slot)
     
    boolean
    isLeftBorder(int row, int column)
     
    boolean
    isMiddle(int slot)
     
    boolean
    isMiddle(int row, int column)
     
    boolean
    isRightBorder(int slot)
     
    boolean
    isRightBorder(int row, int column)
     
    boolean
    isTop(int slot)
     
    boolean
    isTop(int row, int column)
     
    @Nullable SlotIterator
    The SlotIterator of the inventory.
    @NotNull Optional<Integer>
     
    @NotNull Pagination
    The pagination of the inventory.
    int
    Return a random slot in the inventory.
    int
    randomSlot(int min, int max)
    Return a random slot between the specified min and max.
    @Unmodifiable com.google.common.collect.ImmutableMap<String,Object>
     
    void
    This method allows you to reload the contents of the inventory.
    void
    Removes a slot from the list of ignored slots.
    void
    removeAll(@NotNull org.bukkit.inventory.ItemStack item)
    Removes all items that match the parameter.
    void
    removeAll(@NotNull org.bukkit.inventory.ItemStack item, int amount)
    Removes all items that match the parameter.
    void
    Removes the very first item that can be found.
    void
    removeFirst(int amount)
    Removes the very first item that can be found.
    void
    removeFirst(@NotNull org.bukkit.inventory.ItemStack item)
    Removes the first item that matches the parameter.
    void
    removeFirst(@NotNull org.bukkit.Material material)
    Removes the first item that matches the parameter.
    boolean
    Removes the specified slot from the list of ignored slots
    boolean
    removeIgnoredSlots(int @NotNull ... slots)
    Removes all slots from the list of ignored slots
    boolean
    removeItemWithConsumer(int @NotNull ... slots)
    Removes the item from the inventory and the associated consumer.
    boolean
    removeItemWithConsumer(int row, int column)
    Removes the item from the inventory and the associated consumer.
    boolean
    removeProperty(@NotNull String key)
    Removes property with the associated key.
    <T> void
    removeProperty(@NotNull String key, @NotNull Consumer<T> consumer)
    Removes property with the associated key.
    boolean
    replace(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem)
    If the item is found, replace it with the new intelligentitem
    boolean
    replace(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem, int page)
    If the item is found, replace it with the new intelligentitem
    boolean
    replace(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack)
    If the item is found, replace it with the new itemstack
    boolean
    replace(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack, int page)
    If the item is found, replace it with the new itemstack
    boolean
    replace(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial)
    If the item is found, replace it with the new material
    boolean
    replace(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial, int page)
    If the item is found, replace it with the new material
    void
    replaceAll(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem)
    Replace all old items with new items.
    void
    replaceAll(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem, int page)
    Replace all old items with new items.
    void
    replaceAll(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack)
    Replace all old items with new items.
    void
    replaceAll(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack, int page)
    Replace all old items with new items.
    void
    replaceAll(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial)
    Replace all old items with new items.
    void
    replaceAll(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial, int page)
    Replace all old items with new items.
    @NotNull SearchPattern
     
    void
    set(int row, int column, @NotNull IntelligentItem item)
    Sets a fixed intelligent ItemStack in the inventory.
    void
    set(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Sets a fixed ItemStack in the inventory.
    void
    set(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Sets a fixed ItemStack in the inventory.
    void
    set(int slot, @NotNull IntelligentItem item)
    Sets a fixed intelligent ItemStack in the inventory.
    void
    set(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Sets a fixed ItemStack in the inventory.
    void
    set(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type)
    Sets a fixed ItemStack in the inventory.
    void
    set(@NotNull IntelligentItem item, int... slots)
    Sets a fixed intelligent ItemStack in the inventory.
    void
    set(@NotNull List<Integer> slots, @NotNull IntelligentItem item)
    Sets a fixed intelligent ItemStack in the inventory.
    <T> void
    setProperty(@NotNull String key, T value)
    Method to cache property in the content
    void
    setWithinPage(int row, int column, int page, @NotNull IntelligentItem item)
    Sets a fixed IntelligentItem in the inventory on a specified page.
    void
    setWithinPage(int slot, int page, @NotNull IntelligentItem item)
    Sets a fixed intelligent ItemStack in the inventory on a specified page.
    void
    setWithinPage(@NotNull List<Integer> slots, int page, @NotNull IntelligentItem item)
    Sets an item to multiple slots within a page.
    void
    setWithinPage(@NotNull List<Integer> slots, @NotNull List<Integer> pages, @NotNull IntelligentItem item)
    Places an item on multiple pages in multiple slots.
    @NotNull List<Integer>
    Outputs all slots of the inventory to perform operations on the slots.
    void
    subtractFirst(@NotNull org.bukkit.inventory.ItemStack item, int amount)
    Subtracts a value from an ItemStack.
    void
    transferData(@NotNull InventoryContents transferTo)
    If the data is empty, return.
    boolean
    update(int row, int column, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new IntelligentItem.
    boolean
    update(int itemSlot, int newSlot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates item and puts it in a new place in the inventory.
    boolean
    update(int slot, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new IntelligentItem.
    boolean
    update(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack.
    boolean
    update(@NotNull List<Integer> slots, @NotNull IntelligentItem itemStack)
    Update multiple items at once, with a new ItemStack.
    boolean
    update(@NotNull List<Integer> slots, @NotNull IntelligentItem itemStack, int time, @Nullable TimeSetting timeSetting)
    Update multiple items at once, with a new ItemStack.
    boolean
    update(@NotNull List<Integer> slots, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Update multiple items at once, with a new ItemStack.
    void
    updateDisplayName(int slot, @NotNull IntelligentItem item, @NotNull String displayName)
    Updates the display name of the passed item and places it at the slot.
    boolean
    updateDisplayName(int slot, @NotNull String displayName)
    The display name of the ItemStack is updated.
    updateDisplayName(@NotNull IntelligentItem item, @NotNull String displayName)
    Updates the display name of the passed item.
    @NotNull org.bukkit.inventory.ItemStack
    updateDisplayName(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull String displayName)
    Updates the display name of the passed item.
    void
    updateDisplayNameForAll(int slot, @NotNull IntelligentItem item, @NotNull String displayName)
    Updates the display name of the passed item and places it at the slot for all players with the same inventory.
    boolean
    updateDisplayNameForAll(int slot, @NotNull String displayName)
    The display name of the ItemStack is updated for all players with the same inventory.
    void
    updateFixedPageSize(int fixedPageSize)
    This function updates the fixed page size of the inventory.
    void
    updateFixedPageSize(int fixedPageSize, boolean forceUpdate)
    This function updates the fixed page size of the inventory.
    boolean
    updateForAll(int row, int column, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new IntelligentItem for all players with the same inventory.
    boolean
    updateForAll(int itemSlot, int newSlot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates item and puts it in a new place in the inventory for all players in the inventory.
    boolean
    updateForAll(int slot, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new IntelligentItem for all players with the same inventory.
    boolean
    updateForAll(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack for all players with the same inventory.
    boolean
    updateForAll(@NotNull List<Integer> slots, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Update multiple items at once, with a new ItemStack for all players with the same inventory.
    boolean
    updateLore(int row, int column, int index, @NotNull String line)
    Updates the lore of the item.
    boolean
    updateLore(int slot, int index, @NotNull String line)
    Updates the lore of the item.
    boolean
    updateLore(int slot, @NotNull List<String> lore)
    Updates the lore of the item.
    boolean
    updateLore(@NotNull List<Integer> slots, @NotNull List<Integer> indexes, @NotNull List<String> lines)
    Updates multiple lore lines at once.
    boolean
    updateLoreForAll(int row, int column, int index, @NotNull String line)
    Updates the lore of the item for all players with the same inventory.
    boolean
    updateLoreForAll(int slot, int index, @NotNull String line)
    Updates the lore of the item for all players with the same inventory.
    boolean
    updateLoreForAll(int slot, @NotNull List<String> lore)
    Updates the lore of the item for all players with the same inventory.
    boolean
    updateLoreForAll(@NotNull List<Integer> slots, @NotNull List<Integer> indexes, @NotNull List<String> lines)
    Updates multiple lore lines at once for all players with the same inventory.
    boolean
    updateMaterial(int slot, @NotNull org.bukkit.Material material)
    Updates the material of the item in the specified slot.
    boolean
    updateOrSet(int slot, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updateOrSet(int slot, @NotNull IntelligentItem intelligentItem, int time, @Nullable TimeSetting timeSetting)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updateOrSet(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updateOrSet(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack, int time, @Nullable TimeSetting timeSetting)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updateOrSet(@NotNull Collection<Integer> slots, @NotNull IntelligentItem intelligentItem)
    Updates the ItemStack in the same place with a new IntelligentItem or sets if not found.
    boolean
    updateOrSet(@NotNull Collection<Integer> slots, @NotNull IntelligentItem intelligentItem, int time, @Nullable TimeSetting timeSetting)
    Updates the ItemStack in the same place with a new IntelligentItem or sets if not found.
    boolean
    updateOrSet(@NotNull Collection<Integer> slots, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updateOrSet(@NotNull Collection<Integer> slots, @NotNull org.bukkit.inventory.ItemStack itemStack, int time, @Nullable TimeSetting timeSetting)
    Updates the ItemStack in the same place with a new ItemStack or sets if not found.
    boolean
    updatePosition(int itemSlot, int newSlot)
    Updates item position and puts it in a new place in the inventory.
    boolean
    updatePositionForAll(int itemSlot, int newSlot)
    Updates the item position to a new position for all players who have the same inventory open.
    void
    updateTitle(@NotNull String newTitle)
    With this method you can update the inventory title.
    void
    updateTitle(@NotNull net.kyori.adventure.text.Component newTitle)
    With this method you can update the inventory title.
    boolean
    updateViaCoordination(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack.
    boolean
    updateViaCoordination(@NotNull Collection<org.apache.commons.lang3.tuple.ImmutablePair<Integer,Integer>> pairs, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Update multiple items at once, with a new ItemStack.
    boolean
    updateViaCoordinationForAll(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Updates the ItemStack in the same place with a new ItemStack for all players with the same inventory.
    boolean
    updateViaCoordinationForAll(@NotNull Collection<org.apache.commons.lang3.tuple.ImmutablePair<Integer,Integer>> pairs, @NotNull org.bukkit.inventory.ItemStack itemStack)
    Update multiple items at once, with a new ItemStack for all players with the same inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InventoryContents

      public InventoryContents(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull RyseInventory inventory, @NotNull @NotNull org.bukkit.plugin.Plugin plugin)
  • Method Details

    • readOnlyProperties

      public @Unmodifiable com.google.common.collect.ImmutableMap<String,Object> readOnlyProperties()
      Returns:
      A read only map of the properties.
    • firstEqual

      @Nullable public @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem> firstEqual(@NotNull @NotNull org.bukkit.Material material)
      Find the first item in the current page that matches the given material, and return the slot and item.
      Parameters:
      material - The material of the item you want to find.
      Returns:
      A pair of the slot and the item. Or null if no item was found.
    • firstEqual

      @Nullable public @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem> firstEqual(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Find the first item in the current page that matches the given itemStack, and return the slot and item.
      Parameters:
      itemStack - The itemStack of the item you want to find.
      Returns:
      A pair of the slot and the item. Or null if no item was found.
    • firstEqual

      @Nullable public @Nullable org.apache.commons.lang3.tuple.Pair<Integer,IntelligentItem> firstEqual(@NotNull @NotNull IntelligentItem intelligentItem)
      Find the first item in the current page that matches the given Intelligentitem, and return the slot and item.
      Parameters:
      intelligentItem - The Intelligentitem of the item you want to find.
      Returns:
      A pair of the slot and the item. Or null if no item was found.
    • replaceAll

      public void replaceAll(@NotNull @NotNull org.bukkit.Material oldMaterial, @NotNull @NotNull org.bukkit.Material newMaterial, @Nonnegative int page)
      Replace all old items with new items.
      Parameters:
      oldMaterial - The material you want to replace.
      newMaterial - The new material to replace the old material with.
      page - The page you want to search on.
    • replaceAll

      public void replaceAll(@NotNull @NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull @NotNull org.bukkit.inventory.ItemStack newItemStack, @Nonnegative int page)
      Replace all old items with new items.
      Parameters:
      oldItemStack - The itemstack you want to replace.
      newItemStack - The new itemstack to replace the old itemstack with.
      page - The page you want to search on.
    • replaceAll

      public void replaceAll(@NotNull @NotNull IntelligentItem oldIntelligentItem, @NotNull @NotNull IntelligentItem newIntelligentItem, @Nonnegative int page)
      Replace all old items with new items.
      Parameters:
      oldIntelligentItem - The intelligentitem you want to replace.
      newIntelligentItem - The new intelligentitem to replace the old intelligentitem with.
      page - The page you want to search on.
    • replaceAll

      public void replaceAll(@NotNull @NotNull org.bukkit.Material oldMaterial, @NotNull @NotNull org.bukkit.Material newMaterial)
      Replace all old items with new items.
      Parameters:
      oldMaterial - The material you want to replace.
      newMaterial - The new material to replace the old material with.
    • replaceAll

      public void replaceAll(@NotNull @NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull @NotNull org.bukkit.inventory.ItemStack newItemStack)
      Replace all old items with new items.
      Parameters:
      oldItemStack - The itemstack you want to replace.
      newItemStack - The new itemstack to replace the old itemstack with.
    • replaceAll

      public void replaceAll(@NotNull @NotNull IntelligentItem oldIntelligentItem, @NotNull @NotNull IntelligentItem newIntelligentItem)
      Replace all old items with new items.
      Parameters:
      oldIntelligentItem - The intelligentitem you want to replace.
      newIntelligentItem - The new intelligentitem to replace the old intelligentitem with.
    • replace

      public boolean replace(@NotNull @NotNull org.bukkit.Material oldMaterial, @NotNull @NotNull org.bukkit.Material newMaterial, @Nonnegative int page)
      If the item is found, replace it with the new material
      Parameters:
      oldMaterial - The material you want to replace.
      newMaterial - The new material to replace the old material with.
      page - The page you want to search on.
      Returns:
      true if the item was found and replaced.
    • replace

      public boolean replace(@NotNull @NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull @NotNull org.bukkit.inventory.ItemStack newItemStack, @Nonnegative int page)
      If the item is found, replace it with the new itemstack
      Parameters:
      oldItemStack - The itemstack you want to replace.
      newItemStack - The new itemstack to replace the old material with.
      page - The page you want to search on.
      Returns:
      true if the item was found and replaced.
    • replace

      public boolean replace(@NotNull @NotNull IntelligentItem oldIntelligentItem, @NotNull @NotNull IntelligentItem newIntelligentItem, @Nonnegative int page)
      If the item is found, replace it with the new intelligentitem
      Parameters:
      oldIntelligentItem - The intelligentitem you want to replace.
      newIntelligentItem - The new intelligentitem to replace the old intelligentitem with.
      page - The page you want to search on.
      Returns:
      true if the item was found and replaced.
    • replace

      public boolean replace(@NotNull @NotNull org.bukkit.Material oldMaterial, @NotNull @NotNull org.bukkit.Material newMaterial)
      If the item is found, replace it with the new material
      Parameters:
      oldMaterial - The material you want to replace.
      newMaterial - The new material to replace the old material with.
      Returns:
      true if the item was found and replaced.
    • replace

      public boolean replace(@NotNull @NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull @NotNull org.bukkit.inventory.ItemStack newItemStack)
      If the item is found, replace it with the new itemstack
      Parameters:
      oldItemStack - The itemstack you want to replace.
      newItemStack - The new itemstack to replace the old itemstack with.
      Returns:
      true if the item was found and replaced.
    • replace

      public boolean replace(@NotNull @NotNull IntelligentItem oldIntelligentItem, @NotNull @NotNull IntelligentItem newIntelligentItem)
      If the item is found, replace it with the new intelligentitem
      Parameters:
      oldIntelligentItem - The intelligentitem you want to replace.
      newIntelligentItem - The new itemstack to replace the old intelligentitem with.
      Returns:
      true if the item was found and replaced.
    • addAdvancedSlot

      public void addAdvancedSlot(@Nonnegative int slot, @NotNull @NotNull Consumer<org.bukkit.event.inventory.InventoryClickEvent> event) throws IllegalStateException
      In this slot items can be taken or added by the player. However, you can now add your own logic.
      Parameters:
      slot - The slot
      event - Your event with your own logic when the item is clicked.
      Throws:
      IllegalStateException - If the slot has not yet been ignored in the Builder.
    • removeAdvancedSlot

      public void removeAdvancedSlot(@Nonnegative int slot) throws IllegalStateException
      Removes a slot from the list of ignored slots.
      Parameters:
      slot - The slot
      Throws:
      IllegalStateException - If the slot has not yet been ignored in the Builder.
    • updateFixedPageSize

      public void updateFixedPageSize(@Nonnegative int fixedPageSize)
      This function updates the fixed page size of the inventory.
      Parameters:
      fixedPageSize - How many pages are available to the player.

      If players are on page 3, but you now say there are only 2 pages left, the player will automatically be moved to the last page.

    • updateFixedPageSize

      public void updateFixedPageSize(@Nonnegative int fixedPageSize, boolean forceUpdate)
      This function updates the fixed page size of the inventory.
      Parameters:
      fixedPageSize - How many pages are available to the player.
      forceUpdate - If players are on page 3, but you now say there are only 2 pages left, the player will automatically be moved to the last page.
    • update

      public boolean update(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull IntelligentItem itemStack, @Nonnegative int time, @Nullable @Nullable TimeSetting timeSetting) throws IllegalArgumentException
      Update multiple items at once, with a new ItemStack.
      Parameters:
      slots - The slots
      itemStack - The new IntelligentItems what should be displayed.
      time - Defines after which period the item should be updated.
      timeSetting - Defines the time unit.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • update

      public boolean update(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull IntelligentItem itemStack) throws IllegalArgumentException
      Update multiple items at once, with a new ItemStack.
      Parameters:
      slots - The slots
      itemStack - The new IntelligentItems what should be displayed.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@Nonnegative int slot, @NotNull @NotNull IntelligentItem intelligentItem, @Nonnegative int time, @Nullable @Nullable TimeSetting timeSetting) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slot - The slot
      intelligentItem - The new IntelligentItem what should be displayed.
      time - Defines after which period the item should be updated.
      timeSetting - Defines the time unit.
      Returns:
      true if the ItemStack was updated, false if set.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@Nonnegative int slot, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slot - The slot
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if the ItemStack was updated, false if set.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@NotNull @NotNull Collection<Integer> slots, @NotNull @NotNull IntelligentItem intelligentItem, @Nonnegative int time, @Nullable @Nullable TimeSetting timeSetting) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem or sets if not found.
      Parameters:
      slots - The slots
      intelligentItem - The new IntelligentItem what should be displayed.
      time - Defines after which period the item should be updated.
      timeSetting - Defines the time unit.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@NotNull @NotNull Collection<Integer> slots, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem or sets if not found.
      Parameters:
      slots - The slots
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@NotNull @NotNull Collection<Integer> slots, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @Nonnegative int time, @Nullable @Nullable TimeSetting timeSetting) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slots - The slot
      itemStack - The new ItemStack what should be displayed.
      time - Defines after which period the item should be updated.
      timeSetting - Defines the time unit.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@NotNull @NotNull Collection<Integer> slots, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slots - The slot
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @Nonnegative int time, @Nullable @Nullable TimeSetting timeSetting) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slot - The slot
      itemStack - The new ItemStack what should be displayed.
      time - Defines after which period the item should be updated.
      timeSetting - Defines the time unit.
      Returns:
      true if the ItemStack was updated, false if set.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateOrSet

      public boolean updateOrSet(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack or sets if not found.
      Parameters:
      slot - The slot
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated, false if set.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isIgnoredSlot

      public boolean isIgnoredSlot(@Nonnegative int slot)
      Parameters:
      slot - The slot
      Returns:
      true if the slot is ignored.
    • removeIgnoredSlot

      public boolean removeIgnoredSlot(@Nonnegative int slot)
      Removes the specified slot from the list of ignored slots
      Parameters:
      slot - The slot to remove from the ignored slots list.
      Returns:
      true if the slot was removed, false if it was not in the list.
    • removeIgnoredSlots

      public boolean removeIgnoredSlots(int @NotNull ... slots)
      Removes all slots from the list of ignored slots
      Parameters:
      slots - The slots to remove from the ignored slots list.
      Returns:
      true if the slots were removed, false if none were in the list.
    • addIgnoredSlot

      public boolean addIgnoredSlot(@Nonnegative int slot)
      Adds the specified slot to the list of ignored slots
      Parameters:
      slot - The slot to remove from the ignored slots list.
      Returns:
      true if the slot was added, false if it was already in the list.
    • addIgnoredSlots

      public boolean addIgnoredSlots(int @NotNull ... slots)
      Adds all slots to the list of ignored slots
      Parameters:
      slots - The slots to remove from the ignored slots list.
      Returns:
      true if the slots were added, false if none were in the list.
    • hasSlot

      public boolean hasSlot(@Nonnegative int slot) throws IllegalArgumentException
      With this method you can see if a slot exists in the inventory.
      Parameters:
      slot - Which slot to look for.
      Returns:
      true if the slot exists in the inventory.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • hasSlot

      public boolean hasSlot(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      With this method you can see if a slot exists in the inventory.
      Parameters:
      row - Which row to look for.
      column - Which column to look for.
      Returns:
      true if the slot exists in the inventory.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • removeItemWithConsumer

      public boolean removeItemWithConsumer(int @NotNull ... slots) throws IllegalArgumentException
      Removes the item from the inventory and the associated consumer.
      Parameters:
      slots - Which slots should be removed?
      Returns:
      true if the item was removed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • removeItemWithConsumer

      public boolean removeItemWithConsumer(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Removes the item from the inventory and the associated consumer.
      Parameters:
      row - The row where the item is located.
      column - The column where the item is located.
      Returns:
      true if the item was removed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • removeFirst

      public void removeFirst(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Removes the first item that matches the parameter.
      Parameters:
      item - The item to filter for.
    • removeFirst

      public void removeFirst(@NotNull @NotNull org.bukkit.Material material)
      Removes the first item that matches the parameter.
      Parameters:
      material - The material to filter for.
    • subtractFirst

      public void subtractFirst(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @Nonnegative int amount) throws IllegalArgumentException
      Subtracts a value from an ItemStack.
      Parameters:
      item - The ItemStack what should be reduced.
      amount - How much to remove.
      Throws:
      IllegalArgumentException - if amount greater than 64

      If the ItemStack Amount is lower than 1, the ItemStack will be deleted from the inventory.

    • removeAll

      public void removeAll(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Removes all items that match the parameter.
      Parameters:
      item - The item to filter for.
    • removeAll

      public void removeAll(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @Nonnegative int amount) throws IllegalArgumentException
      Removes all items that match the parameter.
      Parameters:
      item - The item to filter for.
      amount - How much to remove.
      Throws:
      IllegalArgumentException - if amount greater than 64
    • removeFirst

      public void removeFirst()
      Removes the very first item that can be found.
    • removeFirst

      public void removeFirst(@Nonnegative int amount) throws IllegalArgumentException
      Removes the very first item that can be found.
      Parameters:
      amount - How much to remove
      Throws:
      IllegalArgumentException - if amount greater than 64
    • slots

      @NotNull public @NotNull List<Integer> slots()
      Outputs all slots of the inventory to perform operations on the slots.
      Returns:
      a list with all slots
    • updateTitle

      public void updateTitle(@NotNull @NotNull String newTitle)
      With this method you can update the inventory title.
      Parameters:
      newTitle - The new title
    • updateTitle

      public void updateTitle(@NotNull @NotNull net.kyori.adventure.text.Component newTitle)
      With this method you can update the inventory title.
      Parameters:
      newTitle - The new title
    • fillAligned

      public void fillAligned(@NotNull @NotNull Alignment alignment, @Nonnegative int howMuch, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      It fills a certain amount of rows or columns with a certain item, depending on the alignment
      Parameters:
      alignment - The alignment of the inventory to fill.
      howMuch - The amount of rows/columns to fill.
      item - The item to fill the inventory with.
      Throws:
      IllegalArgumentException - if howMuch greater than 9
    • fillAligned

      public void fillAligned(@NotNull @NotNull Alignment alignment, @Nonnegative int howMuch, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      It fills a certain amount of rows or columns with a certain item, depending on the alignment
      Parameters:
      alignment - The alignment of the inventory to fill.
      howMuch - The amount of rows/columns to fill.
      item - The item to fill the inventory with.
      Throws:
      IllegalArgumentException - if howMuch greater than 9
    • fillAligned

      public void fillAligned(@NotNull @NotNull Alignment alignment, @Nonnegative int howMuch, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      It fills a certain amount of rows or columns with a certain item, depending on the alignment
      Parameters:
      alignment - The alignment of the inventory to fill.
      howMuch - The amount of rows/columns to fill.
      item - The item to fill the inventory with.
      type - The type of the item.
      Throws:
      IllegalArgumentException - if howMuch greater than 9
    • fillBorders

      public void fillBorders(@NotNull @NotNull IntelligentItem item)
      Fills the Border with a intelligent ItemStack regardless of inventory size.
      Parameters:
      item - The ItemStack which should represent the border
    • fillBorders

      public void fillBorders(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Fills the Border with a ItemStack regardless of inventory size.
      Parameters:
      itemStack - The ItemStack which should represent the border
    • fillBorders

      public void fillBorders(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type)
      Fills the Border with a ItemStack regardless of inventory size.
      Parameters:
      itemStack - The ItemStack which should represent the border
      type - The type of the item
    • hasPropertyKey

      public boolean hasPropertyKey(@NotNull @NotNull String key)
      Return true if the key exists
      Parameters:
      key - The key of the property to check for.
      Returns:
      A boolean value.
    • hasPropertyValue

      public boolean hasPropertyValue(@NotNull @NotNull Object value)
      Return true if the value exists
      Parameters:
      value - The value to search for.
      Returns:
      A boolean value.
    • setProperty

      public <T> void setProperty(@NotNull @NotNull String key, @NotNull T value)
      Method to cache property in the content
      Type Parameters:
      T - The type of the data
      Parameters:
      key - The key of the data
      value - The value of the data
    • getProperty

      @Nullable public <T> T getProperty(@NotNull @NotNull String key)
      Method to get property in the content
      Type Parameters:
      T - The type of the data
      Parameters:
      key - The key of the data
      Returns:
      The cached value, or null if not cached
    • removeProperty

      public boolean removeProperty(@NotNull @NotNull String key)
      Removes property with the associated key.
      Parameters:
      key - The key that will be removed together with the value.
      Returns:
      true if the key was found and removed, false if not.
    • clearProperties

      public void clearProperties()
      Removes all properties in the inventory.
    • clearProperties

      public void clearProperties(@NotNull @NotNull Consumer<List<Object>> consumer)
      Parameters:
      consumer - The consumer Removes all properties in the inventory and returns all values in the consumer.
    • clearProperties

      public void clearProperties(@NotNull @NotNull BiConsumer<List<String>,@NotNull List<Object>> consumer)
      Parameters:
      consumer - The consumer Removes all properties in the inventory and returns all keys and values in the consumer.
    • removeProperty

      public <T> void removeProperty(@NotNull @NotNull String key, @NotNull @NotNull Consumer<T> consumer)
      Removes property with the associated key. The value is then passed in the consumer.
      Type Parameters:
      T - The type of the data
      Parameters:
      key - The key that will be removed together with the value.
      consumer - The value that is removed.
    • getProperty

      @NotNull public <T> T getProperty(@NotNull @NotNull String key, @NotNull @NotNull Object defaultValue)
      Method to get property in the content
      Type Parameters:
      T - The type of the data
      Parameters:
      key - The key of the data
      defaultValue - value when key is invalid
      Returns:
      The cached value
    • findRightBorder

      public int findRightBorder(@Nonnegative int startSlot) throws IllegalArgumentException
      Finds the right border based on the start slot and returns it.
      Parameters:
      startSlot - The start slot.
      Returns:
      the right border index.
      Throws:
      IllegalArgumentException - when startSlot greater than 53
    • findRightBorder

      public int findRightBorder(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Finds the right border based on the start slot and returns it.
      Parameters:
      row - The row of the start slot.
      column - The column of the start slot.
      Returns:
      the right border index.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • findLeftBorder

      public int findLeftBorder(@Nonnegative int startSlot) throws IllegalArgumentException
      Finds the left border based on the start slot and returns it.
      Parameters:
      startSlot - The start slot.
      Returns:
      the left border index.
      Throws:
      IllegalArgumentException - when startSlot greater than 53
    • findLeftBorder

      public int findLeftBorder(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Finds the left border based on the start slot and returns it.
      Parameters:
      row - The row of the start slot.
      column - The column of the start slot.
      Returns:
      the left border index.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • findCorner

      public int findCorner(@NotNull @NotNull CornerType type)
      Finds the corners of the inventory.
      Parameters:
      type - The corner that is searched.
      Returns:
      The slot number of the corner.
    • isMiddle

      public boolean isMiddle(@Nonnegative int slot) throws IllegalArgumentException, IllegalStateException
      Parameters:
      slot - The slot to check
      Returns:
      true if the slot is in the middle of the inventory, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
      IllegalStateException - If the inventory type is not supported.
    • isMiddle

      public boolean isMiddle(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException, IllegalStateException
      Parameters:
      row - The row to check
      column - The column to check
      Returns:
      true if the slot is in the middle of the inventory, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
      IllegalStateException - If the inventory type is not supported.
    • isRightBorder

      public boolean isRightBorder(@Nonnegative int slot) throws IllegalArgumentException
      Parameters:
      slot - The slot to check
      Returns:
      true if the specified slot is on the right side.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isRightBorder

      public boolean isRightBorder(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Parameters:
      column - The column to check
      row - The row to check
      Returns:
      true if the specified slot is on the right side.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isCorner

      public boolean isCorner(@Nonnegative int slot) throws IllegalArgumentException, IllegalStateException
      Parameters:
      slot - The slot to check
      Returns:
      true if the slot is in the corner, false if not
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
      IllegalStateException - If the inventory type is not supported.
    • isCorner

      public boolean isCorner(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException, IllegalStateException
      Parameters:
      row - The row to check
      column - The column to check
      Returns:
      true if the slot is in the corner, false if not
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
      IllegalStateException - If the inventory type is not supported.
    • isTop

      public boolean isTop(@Nonnegative int slot) throws IllegalArgumentException
      Parameters:
      slot - The slot to check
      Returns:
      true when the slot is at the top of the inventory, false otherwise.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isTop

      public boolean isTop(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Parameters:
      row - The row to check
      column - The column to check
      Returns:
      true when the slot is at the top of the inventory, false otherwise.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isBottom

      public boolean isBottom(@Nonnegative int slot) throws IllegalArgumentException
      Parameters:
      slot - The slot to check
      Returns:
      true when the slot is at the bottom of the inventory, false otherwise.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isBottom

      public boolean isBottom(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Parameters:
      row - The row to check
      column - The column to check
      Returns:
      true when the slot is at the bottom of the inventory, false otherwise.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isLeftBorder

      public boolean isLeftBorder(@Nonnegative int slot) throws IllegalArgumentException
      Parameters:
      slot - The slot to check
      Returns:
      true if the specified slot is on the left side.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • isLeftBorder

      public boolean isLeftBorder(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Parameters:
      row - The row to check
      column - The column to check
      Returns:
      true if the specified slot is on the left side.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • firstEmpty

      @NotNull public @NotNull Optional<Integer> firstEmpty()
      Returns:
      The first slot that is empty.
    • lastEmpty

      @NotNull public @NotNull Optional<Integer> lastEmpty()
      Returns:
      The last slot that is empty.
    • randomSlot

      @Nonnegative public int randomSlot()
      Return a random slot in the inventory.
      Returns:
      A random slot in the inventory.
    • randomSlot

      @Nonnegative public int randomSlot(@Nonnegative int min, @Nonnegative int max) throws IllegalArgumentException
      Return a random slot between the specified min and max.
      Returns:
      A random slot in the inventory.
      Throws:
      IllegalArgumentException - if min is greater than max or max is greater than inventory size
    • add

      public boolean add(@NotNull @NotNull IntelligentItem item)
      Adds an item to the inventory in the first free place.
      Parameters:
      item - The ItemStack to be displayed in the inventory
      Returns:
      true if the item was added, false otherwise.
    • add

      public boolean add(IntelligentItem @NotNull ... items)
      Add multiple items to the inventory in the first free place.
      Parameters:
      items - The ItemStacks to be displayed in the inventory
      Returns:
      true if the items were added, false otherwise.
    • add

      public boolean add(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Adds an item to the inventory in the first free place.
      Parameters:
      itemStack - The ItemStack to be displayed in the inventory
      Returns:
      true if the item was added, false otherwise.
    • add

      public boolean add(org.bukkit.inventory.ItemStack @NotNull ... items)
      Add multiple items to the inventory in the first free place.
      Parameters:
      items - The ItemStacks to be displayed in the inventory
      Returns:
      true if the items were added, false otherwise.
    • add

      public boolean add(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type)
      Adds an item to the inventory in the first free place.
      Parameters:
      itemStack - The ItemStack to be displayed in the inventory
      type - The type of the item
      Returns:
      true if the item was added, false otherwise.
    • add

      public boolean add(@NotNull @NotNull IntelligentType type, org.bukkit.inventory.ItemStack @NotNull ... items)
      Adds an item to the inventory in the first free place.
      Parameters:
      items - The ItemStacks to be displayed in the inventory
      type - The type of the item
      Returns:
      true if the items were added, false otherwise.
    • reload

      public void reload()
      This method allows you to reload the contents of the inventory.
    • setWithinPage

      public void setWithinPage(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Sets a fixed intelligent ItemStack in the inventory on a specified page.
      Parameters:
      slot - Where should the item be placed?
      page - On which page should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • setWithinPage

      public void setWithinPage(@Nonnegative int row, @Nonnegative int column, @Nonnegative int page, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Sets a fixed IntelligentItem in the inventory on a specified page.
      Parameters:
      row - The row of the inventory
      column - The column of the inventory
      page - On which page should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • setWithinPage

      public void setWithinPage(@NotNull @NotNull List<Integer> slots, @Nonnegative int page, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Sets an item to multiple slots within a page.
      Parameters:
      slots - Where should the item be placed everywhere?
      page - On which page should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • setWithinPage

      public void setWithinPage(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull List<Integer> pages, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Places an item on multiple pages in multiple slots.
      Parameters:
      slots - Where should the item be placed everywhere?
      pages - On which pages should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • fillRow

      public void fillRow(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Fills a row in the specified page.
      Parameters:
      slot - The slot where the item should be placed
      page - On which page should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillRow

      public void fillRow(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Fills a row in the specified page.
      Parameters:
      slot - The slot where the item should be placed
      page - On which page should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillRow

      public void fillRow(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull IntelligentType type, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Fills a row in the specified page.
      Parameters:
      slot - The slot where the item should be placed
      page - On which page should the item be placed?
      type - The type of the item
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item, @NotNull @NotNull BiConsumer<Integer,@NotNull IntelligentItem> appliedTo) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      type - The type of the item
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillRow

      public void fillRow(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type, @NotNull @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo) throws IllegalArgumentException
      Starting at the slot, the row is completely filled from left to right.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      type - The type of the item
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
      Parameters:
      slot - Where to start placing the items.
      page - On which page should the item be placed?
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
      Parameters:
      slot - Where to start placing the items.
      page - On which page should the item be placed?
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @Nonnegative int page, @NotNull @NotNull IntelligentType type, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Starting with the slot, the object is placed in the same column from top to bottom, but only in the specified page.
      Parameters:
      slot - Where to start placing the items.
      page - On which page should the item be placed?
      type - The type of the item
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item, @NotNull @NotNull BiConsumer<Integer,@NotNull IntelligentItem> appliedTo) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      type - The type of the item
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillColumn

      public void fillColumn(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type, @NotNull @NotNull BiConsumer<Integer,@NotNull org.bukkit.inventory.ItemStack> appliedTo) throws IllegalArgumentException
      Starting at the slot, all the way down the item is placed in the same column.
      Parameters:
      slot - Where to start placing the items.
      item - The item to be placed.
      type - The type of the item
      appliedTo - A consumer that returns slot and item.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillEmptyPage

      public void fillEmptyPage(@Nonnegative int page, @NotNull @NotNull IntelligentItem item)
      Fills all empty slots on a given page.
      Parameters:
      page - The page to be filled.
      item - The item to be placed.

      First page is 0, second page is 1, etc.

    • fillEmptyPage

      public void fillEmptyPage(@Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Fills all empty slots on a given page.
      Parameters:
      page - The page to be filled.
      item - The item to be placed.

      First page is 0, second page is 1, etc.

    • fillEmptyPage

      public void fillEmptyPage(@Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type)
      Fills all empty slots on a given page.
      Parameters:
      page - The page to be filled.
      item - The item to be placed.
      type - The type of the item

      First page is 0, second page is 1, etc.

    • fillPage

      public void fillPage(@Nonnegative int page, @NotNull @NotNull IntelligentItem item)
      Fills a single page completely.
      Parameters:
      page - The page to be filled.
      item - The item to be placed.

      First page is 0, second page is 1, etc.

    • fillPage

      public void fillPage(@Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Fills a single page completely.
      Parameters:
      page - The page to be filled.
      item - The item to be placed.

      First page is 0, second page is 1, etc.

    • fillPage

      public void fillPage(@Nonnegative int page, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type)
      Fills a single page completely.
      Parameters:
      page - The page to be filled.
      itemStack - The item to be placed.
      type - The type of the item

      First page is 0, second page is 1, etc.

    • fillArea

      public void fillArea(@Nonnegative int areaStart, @Nonnegative int areaStop, @NotNull @NotNull IntelligentItem item)
      Specify the area in which items should be filled.
      Parameters:
      areaStart - The start of the area.
      areaStop - The end of the area.
      item - The item to be placed.
    • fillArea

      public void fillArea(@Nonnegative int areaStart, @Nonnegative int areaStop, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Specify the area in which items should be filled.
      Parameters:
      areaStart - The start of the area.
      areaStop - The end of the area.
      item - The item to be placed.
    • fillArea

      public void fillArea(@Nonnegative int areaStart, @Nonnegative int areaStop, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type)
      Specify the area in which items should be filled.
      Parameters:
      areaStart - The start of the area.
      areaStop - The end of the area.
      item - The item to be placed.
      type - The type of the item
    • fillEmpty

      public void fillEmpty(@NotNull @NotNull IntelligentItem item)
      Fills all empty slots within the inventory
      Parameters:
      item - The item to be placed.
    • fillEmpty

      public void fillEmpty(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Fills all empty slots within the inventory
      Parameters:
      itemStack - The item to be placed.
    • fillEmpty

      public void fillEmpty(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type)
      Fills all empty slots within the inventory
      Parameters:
      itemStack - The item to be placed.
      type - The type of the item
    • fillDiagonal

      public void fillDiagonal(@Nonnegative int startSlot, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Fills the inventory diagonally based on the slot.
      Parameters:
      startSlot - The slot where the diagonal should start.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillDiagonal

      public void fillDiagonal(@Nonnegative int startSlot, @NotNull @NotNull org.bukkit.inventory.ItemStack item) throws IllegalArgumentException
      Fills the inventory diagonally based on the slot.
      Parameters:
      startSlot - The slot where the diagonal should start.
      item - The item to be placed.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fillDiagonal

      public void fillDiagonal(@Nonnegative int startSlot, @NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      Fills the inventory diagonally based on the slot.
      Parameters:
      startSlot - The slot where the diagonal should start.
      item - The item to be placed.
      type - The type of the item
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • fill

      public void fill(@NotNull @NotNull IntelligentItem item)
      Fills the whole inventory with an ItemStack.
      Parameters:
      item - The item with which the inventory should be filled.
    • fill

      public void fill(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Fills the whole inventory with an ItemStack.
      Parameters:
      item - The item with which the inventory should be filled.
    • fill

      public void fill(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull IntelligentType type)
      Fills the whole inventory with an ItemStack.
      Parameters:
      item - The item with which the inventory should be filled.
      type - The type of the item
    • set

      public void set(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Sets a fixed intelligent ItemStack in the inventory.
      Parameters:
      slot - Where should the item be placed?
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • set

      public void set(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Sets a fixed ItemStack in the inventory.
      Parameters:
      slot - Where should the item be placed?
      itemStack - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • set

      public void set(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Sets a fixed ItemStack in the inventory.
      Parameters:
      row - The row where the item should be placed
      column - The column where the item should be placed
      itemStack - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • set

      public void set(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      Sets a fixed ItemStack in the inventory.
      Parameters:
      slot - Where should the item be placed?
      itemStack - The ItemStack to be displayed in the inventory
      type - The type of the item
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • set

      public void set(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull IntelligentType type) throws IllegalArgumentException
      Sets a fixed ItemStack in the inventory.
      Parameters:
      row - The row where the item should be placed
      column - The column where the item should be placed
      itemStack - The ItemStack to be displayed in the inventory
      type - The type of the item
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • set

      public void set(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull IntelligentItem item)
      Sets a fixed intelligent ItemStack in the inventory.
      Parameters:
      slots - Where should the item be placed everywhere?
      item - The ItemStack to be displayed in the inventory
    • set

      public void set(@NotNull @NotNull IntelligentItem item, int... slots)
      Sets a fixed intelligent ItemStack in the inventory.
      Parameters:
      item - The ItemStack to be displayed in the inventory
      slots - Where should the item be placed everywhere?
    • set

      public void set(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull IntelligentItem item) throws IllegalArgumentException
      Sets a fixed intelligent ItemStack in the inventory.
      Parameters:
      row - The row
      column - The column
      item - The ItemStack to be displayed in the inventory
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • getPositionOfItem

      @NotNull public @NotNull Optional<Integer> getPositionOfItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Preserve the position of the item in the inventory.
      Parameters:
      itemStack - ItemStack to look for in the inventory.
      Returns:
      The slot of the item or empty Optional if the item was not found.
    • getPositionOfItem

      @NotNull public @NotNull Optional<Integer> getPositionOfItem(@NotNull @NotNull IntelligentItem intelligentItem)
      Preserve the position of the item in the inventory.
      Parameters:
      intelligentItem - IntelligentItem to look for in the inventory.
      Returns:
      The slot of the item or empty Optional if the item was not found.
    • getCoordinationOfItem

      @NotNull public @NotNull Optional<org.apache.commons.lang3.tuple.Pair<Integer,Integer>> getCoordinationOfItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Preserve the position of the item in the inventory.
      Parameters:
      itemStack - ItemStack to look for in the inventory.
      Returns:
      Returns a pair, or nothing if nothing could be found.

      The pair contains the row and column of the item. Pair#getLeft() is the row and Pair#getRight() is the column.

    • getCoordinationOfItem

      @NotNull public @NotNull Optional<org.apache.commons.lang3.tuple.Pair<Integer,Integer>> getCoordinationOfItem(@NotNull @NotNull IntelligentItem intelligentItem)
      Preserve the position of the item in the inventory.
      Parameters:
      intelligentItem - IntelligentItem to look for in the inventory.
      Returns:
      Returns a pair, or nothing if nothing could be found.

      The pair contains the row and column of the item. Pair#getLeft() is the row and Pair#getRight() is the column.

    • getDataFromCurrentPage

      @NotNull public @NotNull List<IntelligentItemData> getDataFromCurrentPage()
      Returns:
      A read-only list of all IntelligentItem's from the current page plus their associated data.
    • getDataFromPage

      @NotNull public @NotNull List<IntelligentItemData> getDataFromPage(@Nonnegative int page)
      Parameters:
      page - The page to get the data from.
      Returns:
      A read-only list of all IntelligentItem's from the page plus their associated data.
    • getAllData

      @NotNull public @NotNull List<IntelligentItemData> getAllData() throws UnsupportedOperationException
      Returns:
      A read-only list of all IntelligentItem's plus their associated data.
      Throws:
      UnsupportedOperationException - If list gets modified.
    • getWithinPage

      public Optional<IntelligentItem> getWithinPage(@Nonnegative int slot, @Nonnegative int page) throws IllegalArgumentException
      Parameters:
      slot - The slot to get the item from.
      page - The page to look for the item in.
      Returns:
      The item in the slot on the page, or empty Optional if the slot is empty.
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • getWithinPage

      public Optional<IntelligentItem> getWithinPage(@Nonnegative int row, @Nonnegative int column, @Nonnegative int page) throws IllegalArgumentException
      Parameters:
      row - The row to get the item from.
      column - The column to look for the item in.
      page - The page to look for the item in.
      Returns:
      The item in the slot on the page, or empty Optional if the slot is empty.
      Throws:
      IllegalArgumentException - if slot greater than 53, slot greater than inventory size or page greater than inventory pages

      First page is 0, second page is 1, etc.

    • getOrAdd

      public Optional<IntelligentItem> getOrAdd(@Nonnegative int slot, @NotNull @NotNull IntelligentItem itemToAdd)
      Get the item inside the slot. If not available, the item will be added.
      Parameters:
      slot - The slot to get the item from.
      itemToAdd - The item to add if the slot is empty.
      Returns:
      The item from the slot, or the item that was added.
    • getOrAdd

      public Optional<IntelligentItem> getOrAdd(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull IntelligentItem itemToAdd)
      Get the item inside the slot. If not available, the item will be added.
      Parameters:
      row - The row to look for the item in.
      column - The column to look for the item in.
      itemToAdd - The item to add if the slot is empty.
      Returns:
      The item from the slot, or the item that was added.
    • getOrSet

      public Optional<IntelligentItem> getOrSet(@Nonnegative int slot, @NotNull @NotNull IntelligentItem itemToSet)
      Get the item inside the slot. If not available, the item will be set.
      Parameters:
      slot - The slot to get the item from.
      itemToSet - The item to set if the slot is empty.
      Returns:
      The item from the slot, or the item that was set.
    • getOrSet

      public Optional<IntelligentItem> getOrSet(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull IntelligentItem itemToSet)
      Get the item inside the slot. If not available, the item will be set.
      Parameters:
      row - The row to look for the item in.
      column - The column to look for the item in.
      itemToSet - The item to set if the slot is empty.
      Returns:
      The item from the slot, or the item that was set.
    • get

      public Optional<IntelligentItem> get(@Nonnegative int slot) throws IllegalArgumentException
      Fetches a intelligent ItemStack based on the slot.
      Parameters:
      slot - The slot
      Returns:
      The intelligent ItemStack or an empty Optional instance.
      Throws:
      IllegalArgumentException - if slot greater than 53
    • get

      @NotNull public @NotNull Optional<IntelligentItem> get(@Nonnegative int row, @Nonnegative int column) throws IllegalArgumentException
      Get a intelligent ItemStack based on the row and column.
      Parameters:
      row - The row
      column - The column
      Returns:
      The intelligent ItemStack or an empty Optional instance.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • get

      @NotNull public @NotNull List<IntelligentItem> get(@NotNull @NotNull List<Integer> slots)
      Get all intelligent ItemStacks.
      Parameters:
      slots - All slots where you want to watch.
      Returns:
      All intelligent ItemStacks that could be found.
    • findInArea

      @NotNull public @NotNull List<IntelligentItem> findInArea(@Nonnegative int areaStart, @Nonnegative int areaStop) throws IllegalArgumentException
      Get multiple Intelligent ItemStacks within the specified range.
      Parameters:
      areaStart - The start slot
      areaStop - The end slot
      Returns:
      All intelligent ItemStacks that could be found.
      Throws:
      IllegalArgumentException - if areaStart, areaStop greater than 53
    • updateLore

      public boolean updateLore(@Nonnegative int row, @Nonnegative int column, @Nonnegative int index, @NotNull @NotNull String line) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item.
      Parameters:
      row - The row to look for the item in.
      column - The column to look for the item in.
      index - Where in the lore should the new line be located.
      line - The new line in the ItemStack
      Returns:
      true if the lore was updated, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLoreForAll

      public boolean updateLoreForAll(@Nonnegative int row, @Nonnegative int column, @Nonnegative int index, @NotNull @NotNull String line) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item for all players with the same inventory.
      Parameters:
      row - The row to look for the item in.
      column - The column to look for the item in.
      index - Where in the lore should the new line be located.
      line - The new line in the ItemStack
      Returns:
      true if the lore was updated for all players, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLore

      public boolean updateLore(@Nonnegative int slot, @NotNull @NotNull List<String> lore) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item.
      Parameters:
      slot - In which slot in the inventory is the ItemStack located.
      lore - The new lore
      Returns:
      true if the lore was updated, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLoreForAll

      public boolean updateLoreForAll(@Nonnegative int slot, @NotNull @NotNull List<String> lore) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item for all players with the same inventory.
      Parameters:
      slot - In which slot in the inventory is the ItemStack located.
      lore - The new lore
      Returns:
      true if the lore was updated for all players, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLore

      public boolean updateLore(@Nonnegative int slot, @Nonnegative int index, @NotNull @NotNull String line) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item.
      Parameters:
      slot - In which slot in the inventory is the ItemStack located.
      index - Where in the lore should the new line be located.
      line - The new line in the ItemStack
      Returns:
      true if the lore was updated, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLoreForAll

      public boolean updateLoreForAll(@Nonnegative int slot, @Nonnegative int index, @NotNull @NotNull String line) throws IllegalArgumentException, IllegalStateException
      Updates the lore of the item for all players with the same inventory.
      Parameters:
      slot - In which slot in the inventory is the ItemStack located.
      index - Where in the lore should the new line be located.
      line - The new line in the ItemStack
      Returns:
      true if the lore was updated for all players, false if the lore was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLore

      public boolean updateLore(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull List<Integer> indexes, @NotNull @NotNull List<String> lines) throws IllegalArgumentException, IllegalStateException
      Updates multiple lore lines at once.
      Parameters:
      slots - The slots where the items are located.
      indexes - The indexes where the lines should be located.
      lines - The lines that should be updated.
      Returns:
      true if all lines of all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size() or lines.size() not equal slots.size() or indexes.size() not equal slots.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateLoreForAll

      public boolean updateLoreForAll(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull List<Integer> indexes, @NotNull @NotNull List<String> lines) throws IllegalArgumentException, IllegalStateException
      Updates multiple lore lines at once for all players with the same inventory.
      Parameters:
      slots - The slots where the items are located.
      indexes - The indexes where the lines should be located.
      lines - The lines that should be updated.
      Returns:
      true if all lines of all items were updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size or index greater equal lore.size() or lines.size() not equal slots.size() or indexes.size() not equal slots.size()
      IllegalStateException - if ItemStack has no ItemMeta or no Lore
    • updateMaterial

      public boolean updateMaterial(@Nonnegative int slot, @NotNull @NotNull org.bukkit.Material material) throws IllegalArgumentException
      Updates the material of the item in the specified slot.
      Parameters:
      slot - The slot to update
      material - The material to set the item to.
      Returns:
      true if the material was updated, false if the material was not updated.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • update

      public boolean update(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack.
      Parameters:
      slot - The slot
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateForAll

      public boolean updateForAll(@Nonnegative int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack for all players with the same inventory.
      Parameters:
      slot - The slot
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateDisplayName

      public boolean updateDisplayName(@Nonnegative int slot, @NotNull @NotNull String displayName) throws IllegalArgumentException
      The display name of the ItemStack is updated.
      Parameters:
      slot - In which slot is the item located?
      displayName - The new display name
      Returns:
      true if the display name was updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateDisplayNameForAll

      public boolean updateDisplayNameForAll(@Nonnegative int slot, @NotNull @NotNull String displayName) throws IllegalArgumentException
      The display name of the ItemStack is updated for all players with the same inventory.
      Parameters:
      slot - In which slot is the item located?
      displayName - The new display name
      Returns:
      true if the display name was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateDisplayName

      public void updateDisplayName(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item, @NotNull @NotNull String displayName) throws IllegalArgumentException
      Updates the display name of the passed item and places it at the slot.
      Parameters:
      slot - Where should the item be placed?
      item - The item which display name should be updated.
      displayName - The new display name
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateDisplayNameForAll

      public void updateDisplayNameForAll(@Nonnegative int slot, @NotNull @NotNull IntelligentItem item, @NotNull @NotNull String displayName) throws IllegalArgumentException
      Updates the display name of the passed item and places it at the slot for all players with the same inventory.
      Parameters:
      slot - Where should the item be placed?
      item - The item which display name should be updated.
      displayName - The new display name
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateDisplayName

      @NotNull public @NotNull IntelligentItem updateDisplayName(@NotNull @NotNull IntelligentItem item, @NotNull @NotNull String displayName) throws IllegalArgumentException
      Updates the display name of the passed item.
      Parameters:
      item - The item which display name should be updated.
      displayName - The new display name
      Returns:
      The updated item
      Throws:
      IllegalArgumentException
    • updateDisplayName

      @NotNull public @NotNull org.bukkit.inventory.ItemStack updateDisplayName(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull String displayName) throws IllegalArgumentException
      Updates the display name of the passed item.
      Parameters:
      itemStack - The item which display name should be updated.
      displayName - The new display name
      Returns:
      The updated item
      Throws:
      IllegalArgumentException
    • update

      public boolean update(@Nonnegative int slot, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem.
      Parameters:
      slot - The slot
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if the IntelligentItem was updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateForAll

      public boolean updateForAll(@Nonnegative int slot, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem for all players with the same inventory.
      Parameters:
      slot - The slot
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • update

      public boolean update(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem.
      Parameters:
      row - The row
      column - The column
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if the ItemStack was updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateForAll

      public boolean updateForAll(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull IntelligentItem intelligentItem) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new IntelligentItem for all players with the same inventory.
      Parameters:
      row - The row
      column - The column
      intelligentItem - The new IntelligentItem what should be displayed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • update

      public boolean update(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Update multiple items at once, with a new ItemStack.
      Parameters:
      slots - The slots
      itemStack - The new ItemStack that should be displayed.
      Returns:
      true if all items were updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateForAll

      public boolean updateForAll(@NotNull @NotNull List<Integer> slots, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Update multiple items at once, with a new ItemStack for all players with the same inventory.
      Parameters:
      slots - The slots
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if all items were updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateViaCoordination

      public boolean updateViaCoordination(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack.
      Parameters:
      column - The column
      row - The row
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateViaCoordinationForAll

      public boolean updateViaCoordinationForAll(@Nonnegative int row, @Nonnegative int column, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates the ItemStack in the same place with a new ItemStack for all players with the same inventory.
      Parameters:
      column - The column
      row - The row
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if slot greater than 53 or slot greater than inventory size
    • updateViaCoordination

      public boolean updateViaCoordination(@NotNull @NotNull Collection<org.apache.commons.lang3.tuple.ImmutablePair<Integer,Integer>> pairs, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Update multiple items at once, with a new ItemStack.
      Parameters:
      pairs - First value is your row, second value is your column.
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if all items were updated, false if not.
    • updateViaCoordinationForAll

      public boolean updateViaCoordinationForAll(@NotNull @NotNull Collection<org.apache.commons.lang3.tuple.ImmutablePair<Integer,Integer>> pairs, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Update multiple items at once, with a new ItemStack for all players with the same inventory.
      Parameters:
      pairs - First value is your row, second value is your column.
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if all items were updated for all players, false if not.
    • update

      public boolean update(@Nonnegative int itemSlot, @Nonnegative int newSlot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates item and puts it in a new place in the inventory.
      Parameters:
      itemSlot - The slot from the old ItemStack
      newSlot - The slot where the new ItemStack will be placed.
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated, false if not.
      Throws:
      IllegalArgumentException - if itemSlot greater than 53 or newSlot greater than 53
    • updateForAll

      public boolean updateForAll(@Nonnegative int itemSlot, @Nonnegative int newSlot, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) throws IllegalArgumentException
      Updates item and puts it in a new place in the inventory for all players in the inventory.
      Parameters:
      itemSlot - The slot from the old ItemStack
      newSlot - The slot where the new ItemStack will be placed.
      itemStack - The new ItemStack what should be displayed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if itemSlot greater than 53 or newSlot greater than 53
    • updatePosition

      public boolean updatePosition(@Nonnegative int itemSlot, @Nonnegative int newSlot) throws IllegalArgumentException
      Updates item position and puts it in a new place in the inventory.
      Parameters:
      itemSlot - The slot from the old ItemStack
      newSlot - The slot where the new ItemStack will be placed.
      Returns:
      true if the ItemStack was updated, false if not.
      Throws:
      IllegalArgumentException - if itemSlot greater than 53 or newSlot greater than 53
    • updatePositionForAll

      public boolean updatePositionForAll(@Nonnegative int itemSlot, @Nonnegative int newSlot) throws IllegalArgumentException
      Updates the item position to a new position for all players who have the same inventory open.
      Parameters:
      itemSlot - The slot from the old ItemStack
      newSlot - The slot where the new ItemStack will be placed.
      Returns:
      true if the ItemStack was updated for all players, false if not.
      Throws:
      IllegalArgumentException - if itemSlot greater than 53 or newSlot greater than 53
    • pagination

      @NotNull public @NotNull Pagination pagination()
      The pagination of the inventory.
      Returns:
      The pagination
    • iterator

      @Nullable public @Nullable SlotIterator iterator()
      The SlotIterator of the inventory.
      Returns:
      null if SlotIterator is not defined
    • searchPattern

      @NotNull public @NotNull SearchPattern searchPattern()
      Returns:
      The SearchPattern of the inventory.
    • contentPattern

      @NotNull public @NotNull ContentPattern contentPattern()
      Returns:
      The ContentPattern of the inventory.
    • transferData

      @Internal public void transferData(@NotNull @NotNull InventoryContents transferTo)
      If the data is empty, return. Otherwise, for each data, set it to the transferTo inventory.
      Parameters:
      transferTo - The InventoryContents object that you are transferring the data to.
    • getInPage

      protected Optional<IntelligentItem> getInPage(@Nonnegative int pageNumber, @Nonnegative int slot) throws IllegalArgumentException
      Returns the item in the specified slot on the specified page, or null if there is no item in that slot.
      Parameters:
      pageNumber - The page number to get the item from.
      slot - The slot in the inventory.
      Returns:
      An optional intelligent item.
      Throws:
      IllegalArgumentException - if slot is greater than 53
    • getPresent

      public Optional<IntelligentItem> getPresent(@Nonnegative int slot) throws IllegalArgumentException
      Fetches a intelligent ItemStack based on the slot.
      Parameters:
      slot - The slot
      Returns:
      The intelligent ItemStack or an empty Optional instance.
      Throws:
      IllegalArgumentException - if slot greater than 53