Class GUIHandler
java.lang.Object
com.bencodez.advancedcore.api.gui.GUIHandler
- Direct Known Subclasses:
RewardGUIConfirmation
Abstract handler for GUI operations supporting multiple display methods.
-
Constructor Summary
ConstructorsConstructorDescriptionGUIHandler(AdvancedCorePlugin plugin, org.bukkit.command.CommandSender player) Constructs a new GUIHandler. -
Method Summary
Modifier and TypeMethodDescriptionColorizes the given string.getChat(org.bukkit.command.CommandSender sender) Gets the chat representation of the GUI.abstract voidonBook(org.bukkit.entity.Player player) Opens the GUI as a book for the player.abstract voidonChat(org.bukkit.command.CommandSender player) Opens the GUI as chat messages for the command sender.abstract voidonChest(org.bukkit.entity.Player player) Opens the GUI as a chest inventory for the player.abstract voidonDialog(org.bukkit.entity.Player player) Opens the GUI as a dialog for the player.abstract voidopen()Opens the GUI using the default method.voidvoidsendMessage(String... message) Sends messages to the command sender.voidsendMessage(ArrayList<String> message) Sends messages to the command sender.voidsendMessageJson(ArrayList<net.md_5.bungee.api.chat.TextComponent> text) Sends JSON text components to the command sender.voidSets data in the data map.
-
Constructor Details
-
GUIHandler
Constructs a new GUIHandler.- Parameters:
plugin- the plugin instanceplayer- the command sender
-
-
Method Details
-
colorize
Colorizes the given string.- Parameters:
str- the string to colorize- Returns:
- the colorized string
-
getChat
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
-
onDialog
public abstract void onDialog(org.bukkit.entity.Player player) Opens the GUI as a dialog for the player.- Parameters:
player- the player
-
sendMessage
Sends messages to the command sender.- Parameters:
message- the list of messages to send
-
sendMessage
Sends messages to the command sender.- Parameters:
message- the messages to send
-
sendMessageJson
Sends JSON text components to the command sender.- Parameters:
text- the text components to send
-
setData
Sets data in the data map.- Parameters:
str- the keyvalue- the value to set
-