Class MenusFile

java.lang.Object
me.tayebyassine.homestead.resources.ResourceFile
me.tayebyassine.homestead.resources.files.MenusFile

public final class MenusFile extends ResourceFile
Typed accessor for the menus YAML configuration file.
  • Constructor Details

  • Method Details

    • get

      public <T> T get(String path)
    • getMenuTitle

      public String getMenuTitle(String menuKey)
      Returns the title for the given menu key.
      Parameters:
      menuKey - the menu key defined in the menus section
      Returns:
      the title string, or the menuKey itself as a fallback
    • getMenuButtonName

      public String getMenuButtonName(String menuKey, int buttonId)
      Returns the display name for a per-menu button.
      Parameters:
      menuKey - the menu configuration key
      buttonId - the button's local integer ID
      Returns:
      the button name, or "UNDEFINED" if not found
    • getMenuButtonLore

      public List<String> getMenuButtonLore(String menuKey, int buttonId)
      Returns the lore lines for a per-menu button.
      Parameters:
      menuKey - the menu configuration key
      buttonId - the button's local integer ID
      Returns:
      the lore lines, or an empty list if not found
    • getMenuButtonType

      public String getMenuButtonType(String menuKey, int buttonId)
      Returns the material type string for a per-menu button.
      Parameters:
      menuKey - the menu configuration key
      buttonId - the button's local integer ID
      Returns:
      the raw material type string (e.g. DIAMOND, PLAYERHEAD-...), or BARRIER if not found
    • getDefaultButtonName

      public String getDefaultButtonName(String name)
      Returns the display name for a named default button (e.g. "back", "prev-page").
      Parameters:
      name - the named button key
      Returns:
      the button name, or "UNDEFINED" if not found
    • getDefaultButtonLore

      public List<String> getDefaultButtonLore(String name)
      Returns the lore lines for a named default button.
      Parameters:
      name - the named button key
      Returns:
      the lore lines, or an empty list if not found
    • getDefaultButtonType

      public String getDefaultButtonType(String name)
      Returns the material type string for a named default button.
      Parameters:
      name - the named button key
      Returns:
      the raw material type string, or "BARRIER" if not found
    • hasMenu

      public boolean hasMenu(String menuKey)
      Checks whether a menu section exists for the given key.
      Parameters:
      menuKey - the menu configuration key
      Returns:
      true if the section exists
    • getMenuKeys

      public List<String> getMenuKeys()
      Returns all menu keys defined in the menus section.
      Returns:
      list of menu keys, or an empty list if no menus are defined