-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Feature Request
The Menu builder should have built-in support for filling empty slots with a specified material, eliminating the need for external utility classes.
Problem
Currently, to fill empty slots with filler items, developers must:
- Create a separate utility class (like MenuUtils)
- Manually calculate which slots are occupied
- Create filler SlotItems for all empty slots
- Merge them with the actual items
This adds complexity and boilerplate that the library aims to reduce.
Proposed Solution
Add methods to Menu.Builder for automatic filler handling:
.fillEmptyWith(Material material)- Fill all empty slots.fillEmptyWith(Material material, Component name)- Fill with custom name.fillExcept(int... slots)- Fill all except specified slots.fillRange(int start, int end, Material material)- Fill a range of slots
Example Usage
return Menu.newBuilder()
.size(MENU_SIZE)
.title(MENU_TITLE)
.items(items) // Only the actual menu items
.fillEmptyWith(Material.GRAY_STAINED_GLASS_PANE)
.build();Benefits
- Eliminates need for MenuUtils helper class
- Reduces boilerplate code
- Makes the library more self-contained
- Improves developer experience
Reactions are currently unavailable