Interface MenuUtils


public interface MenuUtils
Class that holds some useful utils for custom menus.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close(org.bukkit.entity.Player player, boolean checkForCancel)
    Close the current inventory of a player.
    getPlayerMenu(org.bukkit.entity.Player player)
    Get the current AdditionsMenu that the player has open.
    boolean
    Check if a material is legacy (<1.13)
    void
    restoreInventory(org.bukkit.entity.Player player)
    Restore the player's stored inventory.
    void
    setPlayerMenu(org.bukkit.entity.Player player, AdditionsMenu menu)
    Set the current AdditionsMenu that the player has open.
    void
    storeInventory(org.bukkit.entity.Player player)
    Store the player's current inventory.
  • Method Details

    • storeInventory

      void storeInventory(org.bukkit.entity.Player player)
      Store the player's current inventory.
      Parameters:
      player - Player to store inventory of.
    • restoreInventory

      void restoreInventory(org.bukkit.entity.Player player)
      Restore the player's stored inventory.
      Parameters:
      player - Player to restore inventory of.
    • setPlayerMenu

      void setPlayerMenu(org.bukkit.entity.Player player, AdditionsMenu menu)
      Set the current AdditionsMenu that the player has open.
      Parameters:
      player - Player to update.
      menu - AdditionsMenu that is open.
    • getPlayerMenu

      AdditionsMenu getPlayerMenu(org.bukkit.entity.Player player)
      Get the current AdditionsMenu that the player has open.
      Parameters:
      player - Player to check.
      Returns:
      AdditionsMenu if open, null otherwise.
    • close

      void close(org.bukkit.entity.Player player, boolean checkForCancel)
      Close the current inventory of a player.
      Parameters:
      player - Player to close inventory of.
      checkForCancel - Whether to check if this event is cancelled.
    • isMaterialLegacy

      boolean isMaterialLegacy(String material)
      Check if a material is legacy (<1.13)
      Parameters:
      material - Material to check.
      Returns:
      True when legacy, false otherwise.