| Package | Description |
|---|---|
| io.github.portlek.smartinventory |
the package that contains common interfaces.
|
| io.github.portlek.smartinventory.content |
the package that contains
Page's contents. |
| io.github.portlek.smartinventory.event |
the package that contains event classes.
|
| io.github.portlek.smartinventory.event.abs |
the package that contains interfaces of all the events.
|
| io.github.portlek.smartinventory.icon |
the package that contains
Icon implementations. |
| Modifier and Type | Field and Description |
|---|---|
static Icon |
Icon.EMPTY
an empty
Icon instance. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon[][] |
InventoryContents.all()
returns a 2D array of
Icon containing
all the items of the inventory. |
static @NotNull Icon |
Icon.cancel(@NotNull org.bukkit.inventory.ItemStack item)
creates a simple icon from the given
ItemStack with SmartEvent.cancel() interaction. |
@NotNull Icon |
Icon.canSee(@NotNull Predicate<InventoryContents> predicate)
sets the canSee value of the icon to the given predicate.
|
@NotNull Icon |
Icon.canUse(@NotNull Predicate<InventoryContents> predicate)
sets the canUse value of the icon to the given predicate.
|
static @NotNull Icon |
Icon.click(@NotNull org.bukkit.inventory.ItemStack item,
@NotNull Consumer<ClickEvent> consumer,
Predicate<ClickEvent>... requirements)
creates a simple icon from the given
ItemStack with a ClickEvent. |
static @NotNull Icon |
Icon.drag(@NotNull org.bukkit.inventory.ItemStack item,
@NotNull Consumer<DragEvent> consumer,
Predicate<DragEvent>... requirements)
creates a simple icon from the given
ItemStack with a DragEvent. |
@NotNull Icon |
Icon.fallback(@NotNull org.bukkit.inventory.ItemStack fallback)
sets the fallback item of the icon to the given item.
|
static @NotNull Icon |
Icon.from(@NotNull org.bukkit.inventory.ItemStack item)
creates a simple icon from the given
ItemStack. |
@NotNull Icon[] |
Pagination.getPageIcons()
gets the icons of the current page.
|
default <T extends IconEvent> |
Icon.handle(@NotNull Class<T> clazz,
@NotNull Consumer<T> consumer,
@NotNull List<Predicate<T>> requirements)
add the given event and requirements to the icon's handles.
|
<T extends IconEvent> |
Icon.handle(@NotNull Handle<T> handle)
adds the given handle into the icon's handle list.
|
@NotNull Icon |
Icon.handles(@NotNull Collection<Handle<? extends IconEvent>> handles)
adds all the given handles into the icon's handle list.
|
@NotNull Icon |
Icon.item(@NotNull org.bukkit.inventory.ItemStack item)
sets the item of the icon to the given item.
|
default @NotNull Icon |
Icon.whenClick(@NotNull Consumer<ClickEvent> consumer)
adds the given
ClickEvent to the icon's handles. |
default @NotNull Icon |
Icon.whenClick(@NotNull Consumer<ClickEvent> consumer,
@NotNull List<Predicate<ClickEvent>> requirements)
adds the given
ClickEvent with the requirements to the icon's handles. |
default @NotNull Icon |
Icon.whenDrag(@NotNull Consumer<DragEvent> consumer)
adds the given
DragEvent to the icon's handles. |
default @NotNull Icon |
Icon.whenDrag(@NotNull Consumer<DragEvent> consumer,
@NotNull List<Predicate<DragEvent>> requirements)
adds the given
DragEvent with the requirements to the icon's handles. |
default @NotNull Icon |
Icon.whenInteract(@NotNull Consumer<IconEvent> consumer)
adds the given
IconEvent to the icon's handles. |
default @NotNull Icon |
Icon.whenInteract(@NotNull Consumer<IconEvent> consumer,
@NotNull List<Predicate<IconEvent>> requirements)
adds the given
IconEvent with the requirements to the icon's handles. |
| Modifier and Type | Method and Description |
|---|---|
default @NotNull InventoryContents |
InventoryContents.add(@NotNull Icon item)
adds an item to the first empty slot of the inventory.
|
default @NotNull InventoryContents |
InventoryContents.fill(@NotNull Icon item)
fills the inventory with the given item.
|
default @NotNull InventoryContents |
InventoryContents.fillBorders(@NotNull Icon item)
fills the inventory borders with the given item.
|
default @NotNull InventoryContents |
InventoryContents.fillColumn(int column,
@NotNull Icon item)
fills the given inventory column with the given item.
|
default @NotNull InventoryContents |
InventoryContents.fillEmpties(@NotNull Icon item)
fills the empty slots of the inventory with the given item.
|
default @NotNull InventoryContents |
InventoryContents.fillRect(int fromIndex,
int toIndex,
@NotNull Icon item)
fills a rectangle inside the inventory using the given
positions.
|
default @NotNull InventoryContents |
InventoryContents.fillRect(int fromRow,
int fromColumn,
int toRow,
int toColumn,
@NotNull Icon item)
same as
InventoryContents.fillRect(int, int, Icon),
but with SlotPos instead of the indexes. |
default @NotNull InventoryContents |
InventoryContents.fillRect(@NotNull SlotPos fromPos,
@NotNull SlotPos toPos,
@NotNull Icon item)
same as
InventoryContents.fillRect(int, int, Icon),
but with rows and columns instead of the indexes. |
default @NotNull InventoryContents |
InventoryContents.fillRow(int row,
@NotNull Icon item)
fills the given inventory row with the given item.
|
default @NotNull InventoryContents |
InventoryContents.fillSquare(int fromIndex,
int toIndex,
@NotNull Icon item)
completely fills the provided square with the given
Icon. |
default @NotNull InventoryContents |
InventoryContents.fillSquare(int fromRow,
int fromColumn,
int toRow,
int toColumn,
@NotNull Icon item)
completely fills the provided square with the given
Icon. |
default @NotNull InventoryContents |
InventoryContents.fillSquare(@NotNull SlotPos fromPos,
@NotNull SlotPos toPos,
@NotNull Icon item)
completely fills the provided square with the given
Icon. |
default @NotNull Optional<SlotPos> |
InventoryContents.findItem(@NotNull Icon item)
looks for the given icon and compares them using
ItemStack.isSimilar(ItemStack),
ignoring the amount. |
default void |
InventoryContents.removeAll(@NotNull Icon item)
removes all occurrences of the item from the inventory.
|
default void |
InventoryContents.removeAmount(@NotNull Icon item,
int amount)
removes the specified amount of items from the inventory.
|
default void |
InventoryContents.removeFirst(@NotNull Icon item)
clears the first slot where the given item is in.
|
@NotNull SlotIterator |
SlotIterator.set(@NotNull Icon icon)
replaces the icon at the current position in the inventory by the given icon.
|
default @NotNull InventoryContents |
InventoryContents.set(int index,
@Nullable Icon item)
sets the item in the inventory at the given
slot index.
|
@NotNull InventoryContents |
InventoryContents.set(int row,
int column,
@Nullable Icon item)
same as
InventoryContents.set(int, Icon),
but with a row and a column instead of the index. |
default @NotNull InventoryContents |
InventoryContents.set(@NotNull SlotPos slotPos,
@Nullable Icon item)
Same as
InventoryContents.set(int, Icon),
but with a SlotPos instead of the index. |
@NotNull Pagination |
Pagination.setIcons(Icon... icons)
sets all the icons for this Pagination.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon[][] |
BasicInventoryContents.all() |
@NotNull Icon[] |
BasicPagination.getPageIcons() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull SlotIterator |
BasicSlotIterator.set(@NotNull Icon icon) |
@NotNull InventoryContents |
BasicInventoryContents.set(int row,
int column,
@Nullable Icon item) |
@NotNull Pagination |
BasicPagination.setIcons(Icon... icons) |
| Constructor and Description |
|---|
BasicInventoryContents(@NotNull Page page,
@NotNull org.bukkit.entity.Player player,
@NotNull Icon[][] contents)
ctpr.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon |
IcDragEvent.icon() |
@NotNull Icon |
IcClickEvent.icon() |
| Constructor and Description |
|---|
IcClickEvent(@NotNull org.bukkit.plugin.Plugin plugin,
@NotNull org.bukkit.event.inventory.InventoryClickEvent event,
@NotNull InventoryContents contents,
@NotNull Icon icon) |
IcDragEvent(@NotNull org.bukkit.plugin.Plugin plugin,
@NotNull org.bukkit.event.inventory.InventoryDragEvent event,
@NotNull InventoryContents contents,
@NotNull Icon icon) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon |
IconEvent.icon() |
| Modifier and Type | Class and Description |
|---|---|
class |
BasicIcon
an implementation for
Icon. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Icon |
BasicIcon.canSee(@NotNull Predicate<InventoryContents> predicate) |
@NotNull Icon |
BasicIcon.canUse(@NotNull Predicate<InventoryContents> predicate) |
@NotNull Icon |
BasicIcon.fallback(@NotNull org.bukkit.inventory.ItemStack fallback) |
<T extends IconEvent> |
BasicIcon.handle(@NotNull Handle<T> handle) |
@NotNull Icon |
BasicIcon.handles(@NotNull Collection<Handle<? extends IconEvent>> handles) |
@NotNull Icon |
BasicIcon.item(@NotNull org.bukkit.inventory.ItemStack item) |
Copyright © 2021. All rights reserved.