Class ChestListMenu

java.lang.Object
com.enhancedechest.gui.ChestListMenu

public final class ChestListMenu extends Object
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.
A player with more than 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Largest chest count the inventory chooser can show: the 54-slot menu's 4 inner rows × 7 columns = 28.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.Inventory
    build(Locale locale, List<ChestSummary> chests, UUID owner, @Nullable org.bukkit.Location sourceBlock)
    Builds the menu inventory for owner's chests, sized to the chest count.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_CHESTS

      public static final int MAX_CHESTS
      Largest 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

  • 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 for owner's chests, sized to the chest count. Temp (expiring) chests sort first — same order as the dialog list — then natural index order; only the first MAX_CHESTS are placed, so callers must gate on MAX_CHESTS before choosing this menu over the dialog.
      Parameters:
      sourceBlock - ender chest block the menu was opened from (for the lid animation on open), or null