Package com.enhancedechest.gui
Class ChestListMenu
java.lang.Object
com.enhancedechest.gui.ChestListMenu
Builds the simple
/eclist inventory menu — the alternative to ChestDialogs' Dialog-API
list, chosen with enderchest.list-menu: inventory. It is a bare chooser: one icon per owned
chest showing its name / slot count / expiry, and clicking an icon opens that chest directly. None of
the dialog's management actions (rename / set-main / icon / sort) exist here.
Layout. Chest icons sit in an inner rectangle of INNER_COLUMNS columns, framed by a
one-cell border of empty padding cells on every side (top/bottom rows, left/right columns) purely
for spacing. The menu grows a row at a time as the player owns more chests, so the icons stay centred
with even margins:
- up to 7 chests → 27 slots (3 rows, 1 inner row);
- up to 14 → 36 slots (4 rows, 2 inner rows);
- up to 21 → 45 slots (5 rows, 3 inner rows);
- up to 28 → 54 slots (6 rows, 4 inner rows) — the largest a chest inventory can be.
MAX_CHESTS chests can't fit even the 54-slot menu, so callers route
them back to the dialog list instead.
All text reuses the existing gui.yml dialog keys (title, slot count, expiry, main tag), so
this mode adds no new language strings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLargest chest count the inventory chooser can show: the 54-slot menu's 4 inner rows × 7 columns = 28. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.Inventorybuild(Locale locale, List<ChestSummary> chests, UUID owner, @Nullable org.bukkit.Location sourceBlock) Builds the menu inventory forowner's chests, sized to the chest count.
-
Field Details
-
MAX_CHESTS
public static final int MAX_CHESTSLargest chest count the inventory chooser can show: the 54-slot menu's 4 inner rows × 7 columns = 28. Callers fall back to the dialog list above this (a 54-slot inventory can't hold more).- See Also:
-
-
Constructor Details
-
ChestListMenu
-
-
Method Details
-
build
public org.bukkit.inventory.Inventory build(Locale locale, List<ChestSummary> chests, UUID owner, @Nullable @Nullable org.bukkit.Location sourceBlock) Builds the menu inventory forowner's chests, sized to the chest count. Temp (expiring) chests sort first — same order as the dialog list — then natural index order; only the firstMAX_CHESTSare placed, so callers must gate onMAX_CHESTSbefore choosing this menu over the dialog.- Parameters:
sourceBlock- ender chest block the menu was opened from (for the lid animation on open), or null
-