public interface Icon
ItemStack to put the given inventory.| Modifier and Type | Field and Description |
|---|---|
static Icon |
EMPTY
an empty
Icon instance. |
| Modifier and Type | Method and Description |
|---|---|
<T extends IconEvent> |
accept(T event)
accepts the upcoming event for all of the handles.
|
@NotNull org.bukkit.inventory.ItemStack |
calculateItem(@NotNull InventoryContents contents)
calculates and returns the item of the icon.
|
static @NotNull Icon |
cancel(@NotNull org.bukkit.inventory.ItemStack item)
creates a simple icon from the given
ItemStack with SmartEvent.cancel() interaction. |
@NotNull Icon |
canSee(@NotNull Predicate<InventoryContents> predicate)
sets the canSee value of the icon to the given predicate.
|
@NotNull Icon |
canUse(@NotNull Predicate<InventoryContents> predicate)
sets the canUse value of the icon to the given predicate.
|
static @NotNull 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 |
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 |
fallback(@NotNull org.bukkit.inventory.ItemStack fallback)
sets the fallback item of the icon to the given item.
|
static @NotNull Icon |
from(@NotNull org.bukkit.inventory.ItemStack item)
creates a simple icon from the given
ItemStack. |
@NotNull org.bukkit.inventory.ItemStack |
getItem()
obtains the icon's
ItemStack. |
default <T extends IconEvent> |
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> |
handle(@NotNull Handle<T> handle)
adds the given handle into the icon's handle list.
|
@NotNull Icon |
handles(@NotNull Collection<Handle<? extends IconEvent>> handles)
adds all the given handles into the icon's handle list.
|
@NotNull Icon |
item(@NotNull org.bukkit.inventory.ItemStack item)
sets the item of the icon to the given item.
|
default @NotNull Icon |
whenClick(@NotNull Consumer<ClickEvent> consumer)
adds the given
ClickEvent to the icon's handles. |
default @NotNull 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 |
whenDrag(@NotNull Consumer<DragEvent> consumer)
adds the given
DragEvent to the icon's handles. |
default @NotNull 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 |
whenInteract(@NotNull Consumer<IconEvent> consumer)
adds the given
IconEvent to the icon's handles. |
default @NotNull Icon |
whenInteract(@NotNull Consumer<IconEvent> consumer,
@NotNull List<Predicate<IconEvent>> requirements)
adds the given
IconEvent with the requirements to the icon's handles. |
@NotNull static @NotNull Icon from(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
ItemStack.item - the item to create.@SafeVarargs @NotNull static @NotNull Icon click(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull Consumer<ClickEvent> consumer, @NotNull Predicate<ClickEvent>... requirements)
ItemStack with a ClickEvent.item - the item to create.consumer - the consumer to run.requirements - the requirements to check.@SafeVarargs @NotNull static @NotNull Icon drag(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull Consumer<DragEvent> consumer, @NotNull Predicate<DragEvent>... requirements)
ItemStack with a DragEvent.item - the item to create.consumer - the consumer to run.requirements - the requirements to check.@NotNull static @NotNull Icon cancel(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
ItemStack with SmartEvent.cancel() interaction.item - the item to create.@NotNull default @NotNull Icon whenInteract(@NotNull @NotNull Consumer<IconEvent> consumer)
IconEvent to the icon's handles.consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Icon whenInteract(@NotNull @NotNull Consumer<IconEvent> consumer, @NotNull @NotNull List<Predicate<IconEvent>> requirements)
IconEvent with the requirements to the icon's handles.consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Icon whenDrag(@NotNull @NotNull Consumer<DragEvent> consumer)
DragEvent to the icon's handles.consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Icon whenDrag(@NotNull @NotNull Consumer<DragEvent> consumer, @NotNull @NotNull List<Predicate<DragEvent>> requirements)
DragEvent with the requirements to the icon's handles.consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Icon whenClick(@NotNull @NotNull Consumer<ClickEvent> consumer)
ClickEvent to the icon's handles.consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Icon whenClick(@NotNull @NotNull Consumer<ClickEvent> consumer, @NotNull @NotNull List<Predicate<ClickEvent>> requirements)
ClickEvent with the requirements to the icon's handles.consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default <T extends IconEvent> @NotNull Icon handle(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull Consumer<T> consumer, @NotNull @NotNull List<Predicate<T>> requirements)
T - type of the event.clazz - the class to determine the type of the event.consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull @NotNull org.bukkit.inventory.ItemStack getItem()
ItemStack.@NotNull
@NotNull org.bukkit.inventory.ItemStack calculateItem(@NotNull
@NotNull InventoryContents contents)
canSee with the given contents, and if it returns true,
returns getItem() else, returns the fallback.contents - the contents to calculate.<T extends IconEvent> void accept(@NotNull T event)
T - type of the event.event - the event to accept.@NotNull <T extends IconEvent> @NotNull Icon handle(@NotNull @NotNull Handle<T> handle)
T - type of the event.handle - the handle to add.this, for chained calls.@NotNull @NotNull Icon handles(@NotNull @NotNull Collection<Handle<? extends IconEvent>> handles)
handles - the handles to add.this, for chained calls.@NotNull @NotNull Icon canSee(@NotNull @NotNull Predicate<InventoryContents> predicate)
predicate - the predicate to set.this, for chained calls.@NotNull @NotNull Icon canUse(@NotNull @NotNull Predicate<InventoryContents> predicate)
predicate - the predicate to set.this, for chained calls.@NotNull @NotNull Icon fallback(@NotNull @NotNull org.bukkit.inventory.ItemStack fallback)
fallback - the fallback to set.this, for chained calls.@NotNull @NotNull Icon item(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
item - the item to set.this, for chained calls.Copyright © 2021. All rights reserved.