Package space.maxus.flare.ui.compose
Interface ContainerSlot
- All Superinterfaces:
Composable,ComposableLike,Configurable<ContainerSlot>,Disable
ContainerSlot is a component that can have an item placed in it.
See more in Flare docs: Container Slot
See more in Flare docs: Container Slot
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for ContainerSlotstatic interfacestatic interfaceNested classes/interfaces inherited from interface space.maxus.flare.ui.compose.Configurable
Configurable.Configurator<S> -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ContainerSlot.Builderbuilder()Constructs a new container slot builderstatic ItemStackBuilderemptyBuilder(@Nullable String name, @Nullable String description) Returns item builder for empty container slot itemstatic @NotNull ItemProviderReturns item provider for empty container slot itemdefault @Nullable org.bukkit.inventory.ItemStackgetItem()Gets the item inside this containerReactiveState<org.bukkit.inventory.ItemStack>Returns the reactive state of an item inside this containerstatic @NotNull ContainerSlotof(@NotNull ContainerSlot.ContainerEvent onPut, @NotNull ContainerSlot.ContainerEvent onTake) Constructs a new container slot with handlersdefault voidsetItem(@Nullable org.bukkit.inventory.ItemStack stack) Sets the item inside this containerMethods inherited from interface space.maxus.flare.ui.Composable
asComposable, bind, click, context, contextOrNull, destroy, drag, injectRoot, inside, into, leftClick, markDirty, renderAt, restore, rightClick, root, shiftFrom, shiftInto, viewerMethods inherited from interface space.maxus.flare.ui.compose.Configurable
configure, configureTypedMethods inherited from interface space.maxus.flare.ui.compose.Disable
disabledState, isDisabled, isNotDisabled, setDisabled
-
Method Details
-
emptyBuilder
static ItemStackBuilder emptyBuilder(@Nullable @Nullable String name, @Nullable @Nullable String description) Returns item builder for empty container slot item- Parameters:
name- Extra message in item namedescription- Extra description- Returns:
- Item builder for empty container slot item
-
emptyItem
@Contract("_, _ -> new") @NotNull static @NotNull ItemProvider emptyItem(@Nullable @Nullable String name, @Nullable @Nullable String description) Returns item provider for empty container slot item- Parameters:
name- Extra message in item namedescription- Extra description- Returns:
- Item provider for empty container slot item
-
of
@NotNull static @NotNull ContainerSlot of(@NotNull @NotNull ContainerSlot.ContainerEvent onPut, @NotNull @NotNull ContainerSlot.ContainerEvent onTake) Constructs a new container slot with handlers- Parameters:
onPut- Put handleronTake- Take handler- Returns:
- New container slot with handlers
-
builder
Constructs a new container slot builder- Returns:
- New container slot builder
-
itemState
ReactiveState<org.bukkit.inventory.ItemStack> itemState()Returns the reactive state of an item inside this container- Returns:
- Reactive state of an item inside this container
-
getItem
@Nullable default @Nullable org.bukkit.inventory.ItemStack getItem()Gets the item inside this container- Returns:
- Item inside this container
-
setItem
default void setItem(@Nullable @Nullable org.bukkit.inventory.ItemStack stack) Sets the item inside this container- Parameters:
stack- Item inside this container
-