Package studio.mevera.lotus.api.button
Interface Button
- All Known Implementing Classes:
ClickableButton,CompositeButton,CycleButton,SpanningButton,StaticButton,TransformingButton
public sealed interface Button
permits StaticButton, ClickableButton, TransformingButton, SpanningButton, CompositeButton, CycleButton
Sealed root of the button algebra. A button is the union of its display item, attached data,
and (variant-specific) interaction behaviour.
Variants:
StaticButton— display only, click is a no-op (caller may still cancel).ClickableButton— runs aClickActionon click.TransformingButton— replaces itself in the view on click via a transformer.SpanningButton— single logical button occupying multiple adjacent slots.CompositeButton— fan-outs a click to several child buttons in order.CycleButton— N-state button; each click advances to the next state.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ClickableButtonclickable(@NotNull org.bukkit.inventory.ItemStack item, @NotNull ClickAction action) static @NotNull CompositeButtonstatic @NotNull CycleButton@NotNull DataRegistrydata()voiddispatch(@NotNull MenuView<?, ?> view, @NotNull org.bukkit.event.inventory.InventoryClickEvent event) @NotNull org.bukkit.inventory.ItemStackitem()static @NotNull StaticButtonof(@NotNull org.bukkit.inventory.ItemStack item) static @NotNull SpanningButtonspanning(@NotNull org.bukkit.inventory.ItemStack item, @NotNull Set<Slot> footprint, @NotNull ClickAction action) static @NotNull TransformingButtontransforming(@NotNull org.bukkit.inventory.ItemStack item, @NotNull BiFunction<MenuView<?, ?>, org.bukkit.event.inventory.InventoryClickEvent, Button> transformer) @NotNull ButtonwithItem(@NotNull org.bukkit.inventory.ItemStack item)
-
Method Details
-
item
@NotNull @NotNull org.bukkit.inventory.ItemStack item() -
data
-
withItem
-
of
-
clickable
@NotNull static @NotNull ClickableButton clickable(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull ClickAction action) -
transforming
@NotNull static @NotNull TransformingButton transforming(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull BiFunction<MenuView<?, ?>, org.bukkit.event.inventory.InventoryClickEvent, Button> transformer) -
spanning
@NotNull static @NotNull SpanningButton spanning(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull Set<Slot> footprint, @NotNull @NotNull ClickAction action) -
composite
@NotNull static @NotNull CompositeButton composite(@NotNull @NotNull org.bukkit.inventory.ItemStack item, @NotNull @NotNull Button... children) -
cycle
-