Class ChestBackend
java.lang.Object
com.ultikits.ultitools.ui.chest.ChestBackend
- All Implemented Interfaces:
BoundSlotRenderer, UiBackend
The framework's grid-only backend. All screen items are copies, never the source of real item moves.
-
Nested Class Summary
Nested classes/interfaces inherited from interface UiBackend
UiBackend.BackendCallbacks<R> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChestBackend(UiRuntime runtime, ItemRenderer items, Messages messages, Scheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the screen ofsessionif this backend opened it and it is still showing; called at most once per opened session, after the outcome is chosen and before the result completes.net.kyori.adventure.key.Keyid()Unique backend identity.private org.bukkit.inventory.ItemStack<R> voidopen(UiSession<R> session, UiBackend.BackendCallbacks<R> callbacks) Openssession's intent; reports throughcallbacks.intpriority()Higher wins; unique among registered backends.private static voidvoidredraw(GridSession session, Map<GridSlot, org.bukkit.inventory.ItemStack> picture) Drawspicture(copies) onsession's screen.private voidrender(ChestScreen screen, Grid grid) booleanWhether this backend can showintenttoviewernow.voidupdate(GridSession session, Grid previous, Grid next) Showsnextinstead ofpreviouson a grid this backend opened, before returning.
-
Field Details
-
runtime
-
items
-
messages
-
scheduler
-
screens
-
-
Constructor Details
-
ChestBackend
-
-
Method Details
-
id
-
priority
-
supports
Description copied from interface:UiBackendWhether this backend can showintenttoviewernow. May depend on the intent's content (for example the inputs of a form) and on the viewer (for example client capabilities). -
open
Description copied from interface:UiBackendOpenssession's intent; reports throughcallbacks. For aGridit showsGridSession.current()as it is at this call, which may already differ from the intent. -
update
Description copied from interface:UiBackendShowsnextinstead ofpreviouson a grid this backend opened, before returning.previousis the snapshot this backend was last given (byopenorupdate). Called only while the session is open. A backend that cannot change the title of a shown screen may reopen it to show a new title; that does not end the session. -
redraw
Description copied from interface:BoundSlotRendererDrawspicture(copies) onsession's screen. Called in the viewer's entity task.- Specified by:
redrawin interfaceBoundSlotRenderer
-
close
Description copied from interface:UiBackendCloses the screen ofsessionif this backend opened it and it is still showing; called at most once per opened session, after the outcome is chosen and before the result completes. Called in a task of the viewer's entity context; in a task of the global context if the viewer has quit, when the screen is already gone and the backend must only release its own bookkeeping; or on the unloading thread during owner unload. -
render
-
item
-
put
private static void put(org.bukkit.inventory.Inventory inventory, GridSlot slot, org.bukkit.inventory.ItemStack item)
-