Class ActionBarHandler
java.lang.Object
me.fami6xx.rpuniverse.core.misc.basichandlers.ActionBarHandler
The ActionBarHandler is the main class for handling the action bars.
It is responsible for adding, removing, and updating the action bars.
The ActionBarHandler is a singleton class, so only one instance of it should be created.
The ActionBarHandler is also a listener for the PlayerJoinEvent and PlayerQuitEvent. This means that the ActionBarHandler will also listen for these events and update the action bars accordingly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(org.bukkit.entity.Player player, String message)Add a message to the player's action bar.voidaddMessage(org.bukkit.entity.Player player, String message, boolean force)Add a message to the player's action bar.voidAdd a player to the playerMessages map and start cycling messages for that player.getMessages(org.bukkit.entity.Player player)Get queued messages for the player.voidremoveMessage(org.bukkit.entity.Player player, String message)Remove a message from the player's action bar.voidremovePlayer(org.bukkit.entity.Player player)Remove a player from the playerMessages map.
-
Constructor Details
-
ActionBarHandler
public ActionBarHandler()
-
-
Method Details
-
addPlayer
Add a player to the playerMessages map and start cycling messages for that player.- Parameters:
player- The player to add.messages- The list of messages for the player.
-
removePlayer
public void removePlayer(org.bukkit.entity.Player player)Remove a player from the playerMessages map.- Parameters:
player- The player to be removed.
-
addMessage
Add a message to the player's action bar. This method will add the given message to the action bar of the specified player. If the player is not currently displaying any messages, the action bar will start cycling through the messages periodically.- Parameters:
player- The player to add the message for.message- The message to add.force- Whether to immediately display the message on the action bar.
-
addMessage
Add a message to the player's action bar. This method will add the given message to the action bar of the specified player. If the player is not currently displaying any messages, the action bar will start cycling through the messages periodically.- Parameters:
player- The player to add the message for.message- The message to add.
-
getMessages
Get queued messages for the player.- Parameters:
player- The player to get the messages for.- Returns:
- The messages for the player.
-
removeMessage
Remove a message from the player's action bar.- Parameters:
player- The player to remove the message from.message- The message to remove.
-