Class GUIHandler

java.lang.Object
com.bencodez.advancedcore.api.gui.GUIHandler
Direct Known Subclasses:
RewardGUIConfirmation

public abstract class GUIHandler extends Object
Abstract handler for GUI operations supporting multiple display methods.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GUIHandler(AdvancedCorePlugin plugin, org.bukkit.command.CommandSender player)
    Constructs a new GUIHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    Colorizes the given string.
    abstract ArrayList<String>
    getChat(org.bukkit.command.CommandSender sender)
    Gets the chat representation of the GUI.
    abstract void
    onBook(org.bukkit.entity.Player player)
    Opens the GUI as a book for the player.
    abstract void
    onChat(org.bukkit.command.CommandSender player)
    Opens the GUI as chat messages for the command sender.
    abstract void
    onChest(org.bukkit.entity.Player player)
    Opens the GUI as a chest inventory for the player.
    abstract void
    onDialog(org.bukkit.entity.Player player)
    Opens the GUI as a dialog for the player.
    abstract void
    Opens the GUI using the default method.
    void
    open(GUIMethod method)
     
    void
    sendMessage(String... message)
    Sends messages to the command sender.
    void
    Sends messages to the command sender.
    void
    sendMessageJson(ArrayList<net.md_5.bungee.api.chat.TextComponent> text)
    Sends JSON text components to the command sender.
    void
    setData(String str, Object value)
    Sets data in the data map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GUIHandler

      public GUIHandler(AdvancedCorePlugin plugin, org.bukkit.command.CommandSender player)
      Constructs a new GUIHandler.
      Parameters:
      plugin - the plugin instance
      player - the command sender
  • Method Details

    • colorize

      public String colorize(String str)
      Colorizes the given string.
      Parameters:
      str - the string to colorize
      Returns:
      the colorized string
    • getChat

      public abstract ArrayList<String> getChat(org.bukkit.command.CommandSender sender)
      Gets the chat representation of the GUI.
      Parameters:
      sender - the command sender
      Returns:
      the list of chat messages
    • onBook

      public abstract void onBook(org.bukkit.entity.Player player)
      Opens the GUI as a book for the player.
      Parameters:
      player - the player
    • onChat

      public abstract void onChat(org.bukkit.command.CommandSender player)
      Opens the GUI as chat messages for the command sender.
      Parameters:
      player - the command sender
    • onChest

      public abstract void onChest(org.bukkit.entity.Player player)
      Opens the GUI as a chest inventory for the player.
      Parameters:
      player - the player
    • open

      public abstract void open()
      Opens the GUI using the default method.
    • open

      public void open(GUIMethod method)
    • onDialog

      public abstract void onDialog(org.bukkit.entity.Player player)
      Opens the GUI as a dialog for the player.
      Parameters:
      player - the player
    • sendMessage

      public void sendMessage(ArrayList<String> message)
      Sends messages to the command sender.
      Parameters:
      message - the list of messages to send
    • sendMessage

      public void sendMessage(String... message)
      Sends messages to the command sender.
      Parameters:
      message - the messages to send
    • sendMessageJson

      public void sendMessageJson(ArrayList<net.md_5.bungee.api.chat.TextComponent> text)
      Sends JSON text components to the command sender.
      Parameters:
      text - the text components to send
    • setData

      public void setData(String str, Object value)
      Sets data in the data map.
      Parameters:
      str - the key
      value - the value to set