public interface Page
Inventory.| Modifier and Type | Method and Description |
|---|---|
<T extends PageEvent> |
accept(T event)
accepts the upcoming event.
|
boolean |
async()
obtains status of the task in terms of async.
|
@NotNull Page |
async(boolean async)
sets the task's async status.
|
static Page |
build(@NotNull SmartInventory inventory)
creates a simple page instance from the given inventory.
|
static Page |
build(@NotNull SmartInventory inventory,
@NotNull InventoryProvider provider)
creates a simple page instance from the given parameters.
|
default @NotNull Page |
canClose(boolean canClose)
sets the can close to the given boolean.
|
boolean |
canClose(@NotNull CloseEvent event)
checks the can close with the given event.
|
@NotNull Page |
canClose(@NotNull Predicate<CloseEvent> predicate)
sets the can close predicate of the page.
|
default boolean |
checkBounds(int row,
int column)
checks the bounds.
|
void |
close(@NotNull org.bukkit.entity.Player player)
closes the player's page.
|
int |
column()
obtains column of the page.
|
@NotNull Page |
column(int column)
set the column of the page.
|
default <T extends PageEvent> |
handle(@NotNull Class<T> clazz,
@NotNull Consumer<T> consumer,
@NotNull List<Predicate<T>> requirements)
adds the given consumer.
|
<T extends PageEvent> |
handle(@NotNull Handle<T> handle)
adds the given handle.
|
@NotNull String |
id()
obtains id of the page.
|
@NotNull Page |
id(@NotNull String id)
sets the id of the page.
|
@NotNull SmartInventory |
inventory()
obtains the page's inventory manager.
|
void |
notifyUpdate(@NotNull InventoryContents contents)
runs the
provider()'s InventoryProvider.update(InventoryContents) method with the given contents. |
default void |
notifyUpdateForAll()
runs the
InventoryProvider.update(InventoryContents) methods for all players who opened this. |
default void |
notifyUpdateForAllById()
runs the
InventoryProvider.update(InventoryContents) methods for all players who opened this. |
default void |
open(@NotNull org.bukkit.entity.Player player)
opens the page to the given player.
|
default void |
open(@NotNull org.bukkit.entity.Player player,
int page)
opens the page to the given player.
|
@NotNull org.bukkit.inventory.Inventory |
open(@NotNull org.bukkit.entity.Player player,
int page,
@NotNull Map<String,Object> properties)
opens the page for the player.
|
default void |
open(@NotNull org.bukkit.entity.Player player,
@NotNull Map<String,Object> properties)
opens the page to the given player.
|
@NotNull Optional<Page> |
parent()
obtains tha parent page of
this. |
@NotNull Page |
parent(@NotNull Page parent)
sets the parent of the page.
|
@NotNull InventoryProvider |
provider()
obtains the inventory provider.
|
@NotNull Page |
provider(@NotNull InventoryProvider provider)
sets the provider to the given provider
|
int |
row()
obtains row of the page.
|
@NotNull Page |
row(int row)
set the row of the page.
|
long |
startDelay()
obtains the start delay for the task.
|
@NotNull Page |
startDelay(long startDelay)
sets the start delay of the task.
|
long |
tick()
obtains the tick amount.
|
@NotNull Page |
tick(long tick)
sets the tick.
|
boolean |
tickEnable()
obtains the task enable.
|
@NotNull Page |
tickEnable(boolean tickEnable)
sets the task's activity.
|
@NotNull String |
title()
obtains title of the page.
|
@NotNull Page |
title(@NotNull String title)
sets the title of the page.
|
default @NotNull Page |
whenBottomClick(@NotNull Consumer<BottomClickEvent> consumer)
adds the given consumer as a bottom inventory click event.
|
default @NotNull Page |
whenBottomClick(@NotNull Consumer<BottomClickEvent> consumer,
@NotNull List<Predicate<BottomClickEvent>> requirements)
adds the given consumer as a bottom inventory click event.
|
default @NotNull Page |
whenClose(@NotNull Consumer<CloseEvent> consumer)
adds the given consumer as a close event.
|
default @NotNull Page |
whenClose(@NotNull Consumer<CloseEvent> consumer,
@NotNull List<Predicate<CloseEvent>> requirements)
adds the given consumer as a close event.
|
default @NotNull Page |
whenEmptyClick(@NotNull Consumer<PageClickEvent> consumer)
adds the given consumer as a empty slot click event.
|
default @NotNull Page |
whenEmptyClick(@NotNull Consumer<PageClickEvent> consumer,
@NotNull List<Predicate<PageClickEvent>> requirements)
adds the given consumer as a empty slot click event.
|
default @NotNull Page |
whenInit(@NotNull Consumer<InitEvent> consumer)
adds the given consumer as a init event.
|
default @NotNull Page |
whenInit(@NotNull Consumer<InitEvent> consumer,
@NotNull List<Predicate<InitEvent>> requirements)
adds the given consumer as a init event.
|
default @NotNull Page |
whenOpen(@NotNull Consumer<OpenEvent> consumer)
adds the given consumer as a open event.
|
default @NotNull Page |
whenOpen(@NotNull Consumer<OpenEvent> consumer,
@NotNull List<Predicate<OpenEvent>> requirements)
adds the given consumer as a open event.
|
default @NotNull Page |
whenOutsideClick(@NotNull Consumer<OutsideClickEvent> consumer)
adds the given consumer as a outside inventory click event.
|
default @NotNull Page |
whenOutsideClick(@NotNull Consumer<OutsideClickEvent> consumer,
@NotNull List<Predicate<OutsideClickEvent>> requirements)
adds the given consumer as a outside inventory click event.
|
default @NotNull Page |
whenTick(@NotNull Consumer<TickEvent> consumer)
adds the given consumer as a tick event.
|
default @NotNull Page |
whenTick(@NotNull Consumer<TickEvent> consumer,
@NotNull List<Predicate<TickEvent>> requirements)
adds the given consumer as a tick event.
|
default @NotNull Page |
whenUpdate(@NotNull Consumer<UpdateEvent> consumer)
adds the given consumer as a update event.
|
default @NotNull Page |
whenUpdate(@NotNull Consumer<UpdateEvent> consumer,
@NotNull List<Predicate<UpdateEvent>> requirements)
adds the given consumer as a update event.
|
static Page build(@NotNull @NotNull SmartInventory inventory, @NotNull @NotNull InventoryProvider provider)
inventory - the inventory to create.provider - the provider to create.static Page build(@NotNull @NotNull SmartInventory inventory)
inventory - the inventory to create.@NotNull default @NotNull Page whenClose(@NotNull @NotNull Consumer<CloseEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenClose(@NotNull @NotNull Consumer<CloseEvent> consumer, @NotNull @NotNull List<Predicate<CloseEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenOpen(@NotNull @NotNull Consumer<OpenEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenOpen(@NotNull @NotNull Consumer<OpenEvent> consumer, @NotNull @NotNull List<Predicate<OpenEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenInit(@NotNull @NotNull Consumer<InitEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenInit(@NotNull @NotNull Consumer<InitEvent> consumer, @NotNull @NotNull List<Predicate<InitEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenUpdate(@NotNull @NotNull Consumer<UpdateEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenUpdate(@NotNull @NotNull Consumer<UpdateEvent> consumer, @NotNull @NotNull List<Predicate<UpdateEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenTick(@NotNull @NotNull Consumer<TickEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenTick(@NotNull @NotNull Consumer<TickEvent> consumer, @NotNull @NotNull List<Predicate<TickEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenBottomClick(@NotNull @NotNull Consumer<BottomClickEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenBottomClick(@NotNull @NotNull Consumer<BottomClickEvent> consumer, @NotNull @NotNull List<Predicate<BottomClickEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenOutsideClick(@NotNull @NotNull Consumer<OutsideClickEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenOutsideClick(@NotNull @NotNull Consumer<OutsideClickEvent> consumer, @NotNull @NotNull List<Predicate<OutsideClickEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default @NotNull Page whenEmptyClick(@NotNull @NotNull Consumer<PageClickEvent> consumer)
consumer - the consumer to add.this, for chained calls.@NotNull default @NotNull Page whenEmptyClick(@NotNull @NotNull Consumer<PageClickEvent> consumer, @NotNull @NotNull List<Predicate<PageClickEvent>> requirements)
consumer - the consumer to add.requirements - the requirements to add.this, for chained calls.@NotNull default <T extends PageEvent> @NotNull Page 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 <T extends PageEvent> @NotNull Page handle(@NotNull @NotNull Handle<T> handle)
T - type of the event.handle - the handle to add.this, for chained calls.@NotNull default @NotNull Page canClose(boolean canClose)
canClose - the can close to set.this, for chained calls.default void open(@NotNull
@NotNull org.bukkit.entity.Player player)
player - the player to open.default void open(@NotNull
@NotNull org.bukkit.entity.Player player,
int page)
player - the player to open.page - the page to open.default void open(@NotNull
@NotNull org.bukkit.entity.Player player,
@NotNull
@NotNull Map<String,Object> properties)
player - the player to open.properties - the properties to open.default boolean checkBounds(int row,
int column)
row - the row to check.column - the column to check.true if the given row and column are correct for the page size.default void notifyUpdateForAll()
InventoryProvider.update(InventoryContents) methods for all players who opened this.default void notifyUpdateForAllById()
InventoryProvider.update(InventoryContents) methods for all players who opened this.void notifyUpdate(@NotNull
@NotNull InventoryContents contents)
provider()'s InventoryProvider.update(InventoryContents) method with the given contents.contents - the contents to update.<T extends PageEvent> void accept(@NotNull T event)
T - type of the event.event - the event to accept.@NotNull @NotNull InventoryProvider provider()
@NotNull @NotNull Page provider(@NotNull @NotNull InventoryProvider provider)
provider - the provider to set.this, for chained calls.@NotNull @NotNull SmartInventory inventory()
long tick()
@NotNull @NotNull Page tick(long tick)
tick - the tick to set.this, for chained calls.long startDelay()
@NotNull @NotNull Page startDelay(long startDelay)
startDelay - the start delay to set.this, for chained calls.boolean async()
@NotNull @NotNull Page async(boolean async)
async - the async to set.this, for chained calls.boolean tickEnable()
true if the task enable.@NotNull @NotNull Page tickEnable(boolean tickEnable)
tickEnable - the tick enable to set.this, for chained calls.int row()
@NotNull @NotNull Page row(int row)
row - the row to set.this, for chained calls.int column()
@NotNull @NotNull Page column(int column)
column - the row to set.this, for chained calls.@NotNull @NotNull String title()
@NotNull @NotNull Page title(@NotNull @NotNull String title)
title - the title to set.this, for chained calls.@NotNull @NotNull Optional<Page> parent()
this.this.@NotNull @NotNull Page parent(@NotNull @NotNull Page parent)
parent - the parent to set.this, for chained calls.@NotNull @NotNull Page id(@NotNull @NotNull String id)
id - the id to set.this, for chained calls.@NotNull @NotNull String id()
boolean canClose(@NotNull
@NotNull CloseEvent event)
event - the event to check.true if the can close predicate's test returns true.@NotNull @NotNull Page canClose(@NotNull @NotNull Predicate<CloseEvent> predicate)
predicate - the predicate to set.this, for chained calls.@NotNull
@NotNull org.bukkit.inventory.Inventory open(@NotNull
@NotNull org.bukkit.entity.Player player,
int page,
@NotNull
@NotNull Map<String,Object> properties)
player - the player to open.page - the page to open.properties - the properties to open with.Inventory instance.void close(@NotNull
@NotNull org.bukkit.entity.Player player)
player - the player to close.Copyright © 2021. All rights reserved.