Class Menu

    • Constructor Detail

      • Menu

        protected Menu​(Config config)
        Create a new menu
        Parameters:
        config - the config
    • Method Detail

      • getName

        public String getName()
        Get the name
        Returns:
        the name
      • getConfig

        public Config getConfig()
        Get the config
        Returns:
        the config
      • getVariableManager

        public InstanceVariableManager getVariableManager()
        Get the variable manager
        Returns:
        the variable manager
      • getStringReplacers

        public List<StringReplacer> getStringReplacers()
        Get the mutable string replacers
        Returns:
        the string replacers
      • create

        public abstract boolean create​(org.bukkit.entity.Player player,
                                       String[] args,
                                       boolean bypass)
        Called when opening the menu for the player
        Parameters:
        player - the player involved in
        args - the arguments from the open command
        bypass - whether the plugin ignores the permission check
        Returns:
        Whether it's successful
      • tabComplete

        public List<String> tabComplete​(org.bukkit.entity.Player player,
                                        String[] args)
        Called when the player hit TAB when typing the command to open the menu
        Parameters:
        player - the player involved in
        args - the arguments from the open command
        Returns:
        the list of suggestions
      • update

        public abstract void update​(org.bukkit.entity.Player player)
        Called when updating the menu
        Parameters:
        player - the player involved in
      • close

        public abstract void close​(org.bukkit.entity.Player player)
        Close the menu
        Parameters:
        player - the player involved in
      • closeAll

        public abstract void closeAll()
        Close/Clear all inventories of the type
      • getParentMenu

        public Optional<Menu> getParentMenu​(UUID uuid)
        Get the former menu that opened this menu
        Parameters:
        uuid - the unique id
        Returns:
        the former menu
      • setParentMenu

        public void setParentMenu​(UUID uuid,
                                  Menu menu)
        Set the former menu
        Parameters:
        uuid - the unique id
        menu - the former menu
      • replace

        public String replace​(String string,
                              UUID uuid)
        Replace the string
        Parameters:
        string - the string
        uuid - the unique id
        Returns:
        the replaced string