Class MenuItemConfig.Builder
java.lang.Object
net.joseplay.allianceutils.api.menu.MenuItemConfig.Builder
- Enclosing class:
MenuItemConfig
A builder class for creating MenuItemConfig instances in a fluent and readable way.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new MenuItemConfig instance with the configured properties.clickAction(Consumer<org.bukkit.event.inventory.InventoryClickEvent> clickAction) Sets the action to perform when the menu item is clicked.displayName(String displayName) Sets the display name of the menu item.Sets the lore (description) lines of the menu item.material(org.bukkit.Material material) Sets the Material type of the menu item.slot(int slot) Sets the inventory slot for the menu item.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
slot
Sets the inventory slot for the menu item.- Parameters:
slot- The slot number.- Returns:
- This Builder instance for chaining.
-
displayName
Sets the display name of the menu item.- Parameters:
displayName- The display name, with color codes.- Returns:
- This Builder instance for chaining.
-
lore
Sets the lore (description) lines of the menu item.- Parameters:
lore- The list of lore lines, with color codes.- Returns:
- This Builder instance for chaining.
-
material
Sets the Material type of the menu item.- Parameters:
material- The Material to use for the item.- Returns:
- This Builder instance for chaining.
-
clickAction
public MenuItemConfig.Builder clickAction(Consumer<org.bukkit.event.inventory.InventoryClickEvent> clickAction) Sets the action to perform when the menu item is clicked.- Parameters:
clickAction- The Consumer to handle the InventoryClickEvent, or null if no action.- Returns:
- This Builder instance for chaining.
-
build
Builds a new MenuItemConfig instance with the configured properties.- Returns:
- A new MenuItemConfig instance.
-