Class MenuHolder

java.lang.Object
com.kamikazejam.kamicommon.menu.api.MenuHolder
All Implemented Interfaces:
InventoryHolder
Direct Known Subclasses:
AbstractMenu

public class MenuHolder extends Object implements InventoryHolder
InventoryHolder with constructor parameters for making an Inventory with either a row count or an InventoryType.
Also contains a few utility methods for better utilization with the KamiCommon library.
  • Field Details

    • inventory

      @Nullable protected transient @Nullable Inventory inventory
    • title

      @NotNull protected @NotNull String title
    • size

      @NotNull protected @NotNull MenuSize size
  • Constructor Details

    • MenuHolder

      public MenuHolder(@NotNull @NotNull MenuSize size, @Nullable @Nullable String name)
  • Method Details

    • getInventory

      @NotNull public @NotNull Inventory getInventory()
      Specified by:
      getInventory in interface InventoryHolder
    • deleteInventory

      public void deleteInventory()
    • getRawInventory

      @Nullable public @Nullable Inventory getRawInventory()
    • closeAll

      public void closeAll(@NotNull @NotNull Set<UUID> exceptions)
    • getViewers

      @NotNull public @NotNull List<HumanEntity> getViewers()
    • getHolder

      @NotNull public @NotNull InventoryHolder getHolder()
    • getSize

      public int getSize()
    • getMenuSize

      @NotNull public @NotNull MenuSize getMenuSize()
    • getItem

      @Nullable public @Nullable ItemStack getItem(int slot)
    • setItem

      public void setItem(int slot, @Nullable @Nullable ItemStack item)
    • setItem

      public void setItem(int slot, @Nullable @Nullable ItemBuilder builder)
    • clear

      public void clear()
    • firstEmpty

      public int firstEmpty()
    • firstEmpty

      public int firstEmpty(@NotNull @NotNull Collection<Integer> slots)
    • firstEmpty

      public int firstEmpty(int[] slots)
    • replaceTitle

      public void replaceTitle(@NotNull @NotNull String find, @NotNull @NotNull String replacement)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object