Package org.yuemi.libs.api.gui
Interface GuiItem
public interface GuiItem
Represents an interactive item slot in a GUI layout layer.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder interface for constructing GuiItems. -
Method Summary
Modifier and TypeMethodDescriptionstatic GuiItem.Builderbuilder()Creates a new builder for constructing aGuiItem.@NotNull org.bukkit.inventory.ItemStackgetItemStack(@NotNull org.bukkit.entity.Player player) Resolves the ItemStack representation for the specified player.voidonClick(@NotNull GuiClickContext context) Executes the interaction callback when this item is clicked.booleanshouldRender(@NotNull org.bukkit.entity.Player player) Checks if this item should be rendered for the specified player.
-
Method Details
-
getItemStack
@NotNull @NotNull org.bukkit.inventory.ItemStack getItemStack(@NotNull @NotNull org.bukkit.entity.Player player) Resolves the ItemStack representation for the specified player.- Parameters:
player- the viewer player- Returns:
- the rendered item stack
-
shouldRender
boolean shouldRender(@NotNull @NotNull org.bukkit.entity.Player player) Checks if this item should be rendered for the specified player.- Parameters:
player- the viewer player- Returns:
- true if it should render, false otherwise
-
onClick
Executes the interaction callback when this item is clicked.- Parameters:
context- the click context details
-
builder
Creates a new builder for constructing aGuiItem.- Returns:
- a new GuiItem builder
- Throws:
IllegalStateException- if the GUI API provider is not registered
-