java.lang.Object
com.kamikazejam.kamicommon.menu.api.struct.size.MenuSizeRows
All Implemented Interfaces:
MenuSize

public final class MenuSizeRows extends Object implements MenuSize
  • Constructor Details

    • MenuSizeRows

      public MenuSizeRows(int rows)
  • Method Details

    • createInventory

      @NotNull public @NotNull Inventory createInventory(@NotNull @NotNull InventoryHolder holder, @NotNull @NotNull String title)
      Description copied from interface: MenuSize
      Creates a new Inventory with the given InventoryHolder and title.
      Uses this MenuSize to determine the size of the inventory.
      Specified by:
      createInventory in interface MenuSize
    • getSlotInLastRow

      public int getSlotInLastRow(int index)
      Description copied from interface: MenuSize
      Returns the slot number for the slot in the last row with the given index in that row.
      Specified by:
      getSlotInLastRow in interface MenuSize
    • copy

      @NotNull public @NotNull MenuSize copy()
      Description copied from interface: MenuSize
      Deep copies this MenuSize into an identical object clone.
      Specified by:
      copy in interface MenuSize
    • getNumberOfSlots

      public int getNumberOfSlots()
      Specified by:
      getNumberOfSlots in interface MenuSize
      Returns:
      the 1-index number of slots in this menu size.
    • mapPositionToSlot

      public int mapPositionToSlot(int row, int col) throws IllegalStateException
      Description copied from interface: MenuSize
      Maps a position to a slot number. For example position (1, 1) maps to slot 0 (top-left) in a traditional inventory.
      Specified by:
      mapPositionToSlot in interface MenuSize
      Parameters:
      row - The row (top to bottom) of the position. (1-indexed)
      col - The column (left to right) of the position. (1-indexed)
      Returns:
      The bukkit slot number corresponding to the given position.
      Throws:
      IllegalStateException - if this method is called on an unsupported MenuSize (including some MenuSizeTypes using non-standard InventoryType configurations.)
    • mapPositionToSlot

      public static int mapPositionToSlot(int row, int col, int rows) throws IllegalArgumentException
      Throws:
      IllegalArgumentException