Class InventoryContents
- Since:
- 2/17/2022
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryContents(@NotNull org.bukkit.entity.Player player, @NotNull RyseInventory inventory, @NotNull org.bukkit.plugin.Plugin plugin) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(@NotNull IntelligentItem item) Adds an item to the inventory in the first free place.booleanadd(@NotNull IntelligentType type, org.bukkit.inventory.ItemStack @NotNull ... items) Adds an item to the inventory in the first free place.booleanadd(@NotNull org.bukkit.inventory.ItemStack itemStack) Adds an item to the inventory in the first free place.booleanadd(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Adds an item to the inventory in the first free place.booleanadd(IntelligentItem @NotNull ... items) Add multiple items to the inventory in the first free place.booleanadd(org.bukkit.inventory.ItemStack @NotNull ... items) Add multiple items to the inventory in the first free place.voidaddAdvancedSlot(int slot, @NotNull Consumer<org.bukkit.event.inventory.InventoryClickEvent> event) In this slot items can be taken or added by the player.booleanaddIgnoredSlot(int slot) Adds the specified slot to the list of ignored slotsbooleanaddIgnoredSlots(int @NotNull ... slots) Adds all slots to the list of ignored slotsvoidRemoves all properties in the inventory.voidclearProperties(@NotNull BiConsumer<List<String>, @NotNull List<Object>> consumer) voidclearProperties(@NotNull Consumer<List<Object>> consumer) @NotNull ContentPatternvoidfill(@NotNull IntelligentItem item) Fills the whole inventory with an ItemStack.voidfill(@NotNull org.bukkit.inventory.ItemStack item) Fills the whole inventory with an ItemStack.voidfill(@NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Fills the whole inventory with an ItemStack.voidfillAligned(@NotNull Alignment alignment, int howMuch, @NotNull IntelligentItem item) It fills a certain amount of rows or columns with a certain item, depending on the alignmentvoidfillAligned(@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 alignmentvoidfillAligned(@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 alignmentvoidfillArea(int areaStart, int areaStop, @NotNull IntelligentItem item) Specify the area in which items should be filled.voidfillArea(int areaStart, int areaStop, @NotNull org.bukkit.inventory.ItemStack item) Specify the area in which items should be filled.voidfillArea(int areaStart, int areaStop, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Specify the area in which items should be filled.voidfillBorders(@NotNull IntelligentItem item) Fills the Border with a intelligent ItemStack regardless of inventory size.voidfillBorders(@NotNull org.bukkit.inventory.ItemStack itemStack) Fills the Border with a ItemStack regardless of inventory size.voidfillBorders(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Fills the Border with a ItemStack regardless of inventory size.voidfillColumn(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.voidfillColumn(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.voidfillColumn(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.voidfillColumn(int slot, @NotNull IntelligentItem item) Starting at the slot, all the way down the item is placed in the same column.voidfillColumn(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.voidfillColumn(int slot, @NotNull org.bukkit.inventory.ItemStack item) Starting at the slot, all the way down the item is placed in the same column.voidfillColumn(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.voidfillColumn(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.voidfillColumn(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.voidfillDiagonal(int startSlot, @NotNull IntelligentItem item) Fills the inventory diagonally based on the slot.voidfillDiagonal(int startSlot, @NotNull org.bukkit.inventory.ItemStack item) Fills the inventory diagonally based on the slot.voidfillDiagonal(int startSlot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Fills the inventory diagonally based on the slot.voidfillEmpty(@NotNull IntelligentItem item) Fills all empty slots within the inventoryvoidfillEmpty(@NotNull org.bukkit.inventory.ItemStack itemStack) Fills all empty slots within the inventoryvoidfillEmpty(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Fills all empty slots within the inventoryvoidfillEmptyPage(int page, @NotNull IntelligentItem item) Fills all empty slots on a given page.voidfillEmptyPage(int page, @NotNull org.bukkit.inventory.ItemStack item) Fills all empty slots on a given page.voidfillEmptyPage(int page, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Fills all empty slots on a given page.voidfillPage(int page, @NotNull IntelligentItem item) Fills a single page completely.voidfillPage(int page, @NotNull org.bukkit.inventory.ItemStack item) Fills a single page completely.voidfillPage(int page, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Fills a single page completely.voidfillRow(int slot, int page, @NotNull IntelligentItem item) Fills a row in the specified page.voidfillRow(int slot, int page, @NotNull IntelligentType type, @NotNull org.bukkit.inventory.ItemStack item) Fills a row in the specified page.voidfillRow(int slot, int page, @NotNull org.bukkit.inventory.ItemStack item) Fills a row in the specified page.voidfillRow(int slot, @NotNull IntelligentItem item) Starting at the slot, the row is completely filled from left to right.voidfillRow(int slot, @NotNull IntelligentItem item, @NotNull BiConsumer<Integer, @NotNull IntelligentItem> appliedTo) Starting at the slot, the row is completely filled from left to right.voidfillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item) Starting at the slot, the row is completely filled from left to right.voidfillRow(int slot, @NotNull org.bukkit.inventory.ItemStack item, @NotNull IntelligentType type) Starting at the slot, the row is completely filled from left to right.voidfillRow(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.voidfillRow(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.intfindCorner(@NotNull CornerType type) Finds the corners of the inventory.@NotNull List<IntelligentItem>findInArea(int areaStart, int areaStop) Get multiple Intelligent ItemStacks within the specified range.intfindLeftBorder(int startSlot) Finds the left border based on the start slot and returns it.intfindLeftBorder(int row, int column) Finds the left border based on the start slot and returns it.intfindRightBorder(int startSlot) Finds the right border based on the start slot and returns it.intfindRightBorder(int row, int column) Finds the right border based on the start slot and returns it.@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.@NotNull Optional<IntelligentItem>get(int row, int column) Get a intelligent ItemStack based on the row and column.@NotNull List<IntelligentItem>Get all intelligent ItemStacks.@NotNull List<IntelligentItemData>getCoordinationOfItem(@NotNull IntelligentItem intelligentItem) Preserve the position of the item in the inventory.getCoordinationOfItem(@NotNull org.bukkit.inventory.ItemStack itemStack) Preserve the position of the item in the inventory.@NotNull List<IntelligentItemData>@NotNull List<IntelligentItemData>getDataFromPage(int page) protected Optional<IntelligentItem>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.getPositionOfItem(@NotNull IntelligentItem intelligentItem) Preserve the position of the item in the inventory.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> TgetProperty(@NotNull String key) Method to get property in the content<T> TgetProperty(@NotNull String key, @NotNull Object defaultValue) Method to get property in the contentgetWithinPage(int slot, int page) getWithinPage(int row, int column, int page) booleanhasPropertyKey(@NotNull String key) Return true if the key existsbooleanhasPropertyValue(@NotNull Object value) Return true if the value existsbooleanhasSlot(int slot) With this method you can see if a slot exists in the inventory.booleanhasSlot(int row, int column) With this method you can see if a slot exists in the inventory.booleanisBottom(int slot) booleanisBottom(int row, int column) booleanisCorner(int slot) booleanisCorner(int row, int column) booleanisIgnoredSlot(int slot) booleanisLeftBorder(int slot) booleanisLeftBorder(int row, int column) booleanisMiddle(int slot) booleanisMiddle(int row, int column) booleanisRightBorder(int slot) booleanisRightBorder(int row, int column) booleanisTop(int slot) booleanisTop(int row, int column) @Nullable SlotIteratoriterator()The SlotIterator of the inventory.@NotNull PaginationThe pagination of the inventory.intReturn a random slot in the inventory.intrandomSlot(int min, int max) Return a random slot between the specified min and max.voidreload()This method allows you to reload the contents of the inventory.voidremoveAdvancedSlot(int slot) Removes a slot from the list of ignored slots.voidremoveAll(@NotNull org.bukkit.inventory.ItemStack item) Removes all items that match the parameter.voidremoveAll(@NotNull org.bukkit.inventory.ItemStack item, int amount) Removes all items that match the parameter.voidRemoves the very first item that can be found.voidremoveFirst(int amount) Removes the very first item that can be found.voidremoveFirst(@NotNull org.bukkit.inventory.ItemStack item) Removes the first item that matches the parameter.voidremoveFirst(@NotNull org.bukkit.Material material) Removes the first item that matches the parameter.booleanremoveIgnoredSlot(int slot) Removes the specified slot from the list of ignored slotsbooleanremoveIgnoredSlots(int @NotNull ... slots) Removes all slots from the list of ignored slotsbooleanremoveItemWithConsumer(int @NotNull ... slots) Removes the item from the inventory and the associated consumer.booleanremoveItemWithConsumer(int row, int column) Removes the item from the inventory and the associated consumer.booleanremoveProperty(@NotNull String key) Removes property with the associated key.<T> voidremoveProperty(@NotNull String key, @NotNull Consumer<T> consumer) Removes property with the associated key.booleanreplace(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem) If the item is found, replace it with the new intelligentitembooleanreplace(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem, int page) If the item is found, replace it with the new intelligentitembooleanreplace(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack) If the item is found, replace it with the new itemstackbooleanreplace(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack, int page) If the item is found, replace it with the new itemstackbooleanreplace(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial) If the item is found, replace it with the new materialbooleanreplace(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial, int page) If the item is found, replace it with the new materialvoidreplaceAll(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem) Replace all old items with new items.voidreplaceAll(@NotNull IntelligentItem oldIntelligentItem, @NotNull IntelligentItem newIntelligentItem, int page) Replace all old items with new items.voidreplaceAll(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack) Replace all old items with new items.voidreplaceAll(@NotNull org.bukkit.inventory.ItemStack oldItemStack, @NotNull org.bukkit.inventory.ItemStack newItemStack, int page) Replace all old items with new items.voidreplaceAll(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial) Replace all old items with new items.voidreplaceAll(@NotNull org.bukkit.Material oldMaterial, @NotNull org.bukkit.Material newMaterial, int page) Replace all old items with new items.@NotNull SearchPatternvoidset(int row, int column, @NotNull IntelligentItem item) Sets a fixed intelligent ItemStack in the inventory.voidset(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack) Sets a fixed ItemStack in the inventory.voidset(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Sets a fixed ItemStack in the inventory.voidset(int slot, @NotNull IntelligentItem item) Sets a fixed intelligent ItemStack in the inventory.voidset(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack) Sets a fixed ItemStack in the inventory.voidset(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull IntelligentType type) Sets a fixed ItemStack in the inventory.voidset(@NotNull IntelligentItem item, int... slots) Sets a fixed intelligent ItemStack in the inventory.voidset(@NotNull List<Integer> slots, @NotNull IntelligentItem item) Sets a fixed intelligent ItemStack in the inventory.<T> voidsetProperty(@NotNull String key, T value) Method to cache property in the contentvoidsetWithinPage(int row, int column, int page, @NotNull IntelligentItem item) Sets a fixed IntelligentItem in the inventory on a specified page.voidsetWithinPage(int slot, int page, @NotNull IntelligentItem item) Sets a fixed intelligent ItemStack in the inventory on a specified page.voidsetWithinPage(@NotNull List<Integer> slots, int page, @NotNull IntelligentItem item) Sets an item to multiple slots within a page.voidsetWithinPage(@NotNull List<Integer> slots, @NotNull List<Integer> pages, @NotNull IntelligentItem item) Places an item on multiple pages in multiple slots.slots()Outputs all slots of the inventory to perform operations on the slots.voidsubtractFirst(@NotNull org.bukkit.inventory.ItemStack item, int amount) Subtracts a value from an ItemStack.voidtransferData(@NotNull InventoryContents transferTo) If the data is empty, return.booleanupdate(int row, int column, @NotNull IntelligentItem intelligentItem) Updates the ItemStack in the same place with a new IntelligentItem.booleanupdate(int itemSlot, int newSlot, @NotNull org.bukkit.inventory.ItemStack itemStack) Updates item and puts it in a new place in the inventory.booleanupdate(int slot, @NotNull IntelligentItem intelligentItem) Updates the ItemStack in the same place with a new IntelligentItem.booleanupdate(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack) Updates the ItemStack in the same place with a new ItemStack.booleanupdate(@NotNull List<Integer> slots, @NotNull IntelligentItem itemStack) Update multiple items at once, with a new ItemStack.booleanupdate(@NotNull List<Integer> slots, @NotNull IntelligentItem itemStack, int time, @Nullable TimeSetting timeSetting) Update multiple items at once, with a new ItemStack.booleanUpdate multiple items at once, with a new ItemStack.voidupdateDisplayName(int slot, @NotNull IntelligentItem item, @NotNull String displayName) Updates the display name of the passed item and places it at the slot.booleanupdateDisplayName(int slot, @NotNull String displayName) The display name of the ItemStack is updated.@NotNull IntelligentItemupdateDisplayName(@NotNull IntelligentItem item, @NotNull String displayName) Updates the display name of the passed item.@NotNull org.bukkit.inventory.ItemStackupdateDisplayName(@NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull String displayName) Updates the display name of the passed item.voidupdateDisplayNameForAll(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.booleanupdateDisplayNameForAll(int slot, @NotNull String displayName) The display name of the ItemStack is updated for all players with the same inventory.voidupdateFixedPageSize(int fixedPageSize) This function updates the fixed page size of the inventory.voidupdateFixedPageSize(int fixedPageSize, boolean forceUpdate) This function updates the fixed page size of the inventory.booleanupdateForAll(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.booleanupdateForAll(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.booleanupdateForAll(int slot, @NotNull IntelligentItem intelligentItem) Updates the ItemStack in the same place with a new IntelligentItem for all players with the same inventory.booleanupdateForAll(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.booleanupdateForAll(@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.booleanupdateLore(int row, int column, int index, @NotNull String line) Updates the lore of the item.booleanupdateLore(int slot, int index, @NotNull String line) Updates the lore of the item.booleanupdateLore(int slot, @NotNull List<String> lore) Updates the lore of the item.booleanupdateLore(@NotNull List<Integer> slots, @NotNull List<Integer> indexes, @NotNull List<String> lines) Updates multiple lore lines at once.booleanupdateLoreForAll(int row, int column, int index, @NotNull String line) Updates the lore of the item for all players with the same inventory.booleanupdateLoreForAll(int slot, int index, @NotNull String line) Updates the lore of the item for all players with the same inventory.booleanupdateLoreForAll(int slot, @NotNull List<String> lore) Updates the lore of the item for all players with the same inventory.booleanupdateLoreForAll(@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.booleanupdateMaterial(int slot, @NotNull org.bukkit.Material material) Updates the material of the item in the specified slot.booleanupdateOrSet(int slot, @NotNull IntelligentItem intelligentItem) Updates the ItemStack in the same place with a new ItemStack or sets if not found.booleanupdateOrSet(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.booleanupdateOrSet(int slot, @NotNull org.bukkit.inventory.ItemStack itemStack) Updates the ItemStack in the same place with a new ItemStack or sets if not found.booleanupdateOrSet(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.booleanupdateOrSet(@NotNull Collection<Integer> slots, @NotNull IntelligentItem intelligentItem) Updates the ItemStack in the same place with a new IntelligentItem or sets if not found.booleanupdateOrSet(@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.booleanupdateOrSet(@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.booleanupdateOrSet(@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.booleanupdatePosition(int itemSlot, int newSlot) Updates item position and puts it in a new place in the inventory.booleanupdatePositionForAll(int itemSlot, int newSlot) Updates the item position to a new position for all players who have the same inventory open.voidupdateTitle(@NotNull String newTitle) With this method you can update the inventory title.voidupdateTitle(@NotNull net.kyori.adventure.text.Component newTitle) With this method you can update the inventory title.booleanupdateViaCoordination(int row, int column, @NotNull org.bukkit.inventory.ItemStack itemStack) Updates the ItemStack in the same place with a new ItemStack.booleanupdateViaCoordination(@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.booleanupdateViaCoordinationForAll(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.booleanupdateViaCoordinationForAll(@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.
-
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
- 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 slotevent- 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
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 slotsitemStack- 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 slotsitemStack- 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 slotintelligentItem- 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 slotintelligentItem- 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 slotsintelligentItem- 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 slotsintelligentItem- 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 slotitemStack- 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 slotitemStack- 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 slotitemStack- 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 slotitemStack- 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
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
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 64If 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
Removes the very first item that can be found.- Parameters:
amount- How much to remove- Throws:
IllegalArgumentException- if amount greater than 64
-
slots
Outputs all slots of the inventory to perform operations on the slots.- Returns:
- a list with all slots
-
updateTitle
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
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 bordertype- The type of the item
-
hasPropertyKey
Return true if the key exists- Parameters:
key- The key of the property to check for.- Returns:
- A boolean value.
-
hasPropertyValue
Return true if the value exists- Parameters:
value- The value to search for.- Returns:
- A boolean value.
-
setProperty
Method to cache property in the content- Type Parameters:
T- The type of the data- Parameters:
key- The key of the datavalue- The value of the data
-
getProperty
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
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
- 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 datadefaultValue- value when key is invalid- Returns:
- The cached value
-
findRightBorder
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
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
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 sizeIllegalStateException- 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 checkcolumn- 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 sizeIllegalStateException- If the inventory type is not supported.
-
isRightBorder
- 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 checkrow- 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 sizeIllegalStateException- 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 checkcolumn- 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 sizeIllegalStateException- If the inventory type is not supported.
-
isTop
- 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
- Parameters:
row- The row to checkcolumn- 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
- 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 checkcolumn- 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
- 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 checkcolumn- 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
- Returns:
- The first slot that is empty.
-
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
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
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 inventorytype- 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 inventorytype- 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 pagesFirst 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 inventorycolumn- The column of the inventorypage- 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 pagesFirst 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 pagesFirst 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 pagesFirst 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 placedpage- 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 placedpage- 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 placedpage- On which page should the item be placed?type- The type of the itemitem- 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 IllegalArgumentExceptionStarting 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 IllegalArgumentExceptionStarting 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 IllegalArgumentExceptionStarting 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 itemappliedTo- 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 itemitem- 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 IllegalArgumentExceptionStarting 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 IllegalArgumentExceptionStarting 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 IllegalArgumentExceptionStarting 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 itemappliedTo- A consumer that returns slot and item.- Throws:
IllegalArgumentException- if slot greater than 53 or slot greater than inventory size
-
fillEmptyPage
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 itemFirst page is 0, second page is 1, etc.
-
fillPage
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 itemFirst 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
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
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 placedcolumn- The column where the item should be placeditemStack- 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 inventorytype- 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 placedcolumn- The column where the item should be placeditemStack- The ItemStack to be displayed in the inventorytype- The type of the item- Throws:
IllegalArgumentException- if slot greater than 53 or slot greater than inventory size
-
set
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
Sets a fixed intelligent ItemStack in the inventory.- Parameters:
item- The ItemStack to be displayed in the inventoryslots- 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 rowcolumn- The columnitem- 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
- Returns:
- A read-only list of all IntelligentItem's from the current page plus their associated data.
-
getDataFromPage
- 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 pagesFirst 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 pagesFirst 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
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 rowcolumn- 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
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 slotareaStop- 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 updatematerial- 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 slotitemStack- 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 slotitemStack- 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 slotintelligentItem- 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 slotintelligentItem- 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 rowcolumn- The columnintelligentItem- 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 rowcolumn- The columnintelligentItem- 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 slotsitemStack- 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 slotsitemStack- 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 columnrow- The rowitemStack- 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 columnrow- The rowitemStack- 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 ItemStacknewSlot- 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 ItemStacknewSlot- 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 ItemStacknewSlot- 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 ItemStacknewSlot- 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
The pagination of the inventory.- Returns:
- The pagination
-
iterator
The SlotIterator of the inventory.- Returns:
- null if SlotIterator is not defined
-
searchPattern
- Returns:
- The SearchPattern of the inventory.
-
contentPattern
- Returns:
- The ContentPattern of the inventory.
-
transferData
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
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
-