Package wbs.utils.util.plugin
Class WbsMessenger
java.lang.Object
wbs.utils.util.plugin.WbsMessenger
- Direct Known Subclasses:
UtilsCommand,WbsCommand,WbsSubcommand
Provides a few methods to redirect
messaging to the plugin messaging system.
Also provides some permission checking
methods commonly used in classes that
deal with player interaction.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSend a message to all players on the server, formatted automaticallyprotected voidbroadcastActionBar(String message, double radius, org.bukkit.Location loc) protected booleancheckPermission(org.bukkit.command.CommandSender sender, String permission) A method to check whether or not a command sender has a given permission.protected voidsendActionBar(String message, org.bukkit.entity.Player player) Send an action bar to a player with formatting handledprotected <T> intprotected <T> intprotected voidsendMessage(String message, org.bukkit.command.CommandSender sender) Send a message with formatting handled.protected voidsendMessageNoPrefix(String message, org.bukkit.command.CommandSender sender) Same assendMessage(String, CommandSender)but without the prefix
-
Field Details
-
plugin
-
-
Constructor Details
-
WbsMessenger
- Parameters:
plugin- The WbsPlugin to wrap messaging methods for
-
-
Method Details
-
checkPermission
A method to check whether or not a command sender has a given permission. If the sender does not have the permission, they will get a default permission error message so it doesn't need to be handled in other methods.- Parameters:
sender- The command sender to checkpermission- The permission to check- Returns:
- True if the sender has permission
-
sendMessage
Send a message with formatting handled.- Parameters:
message- The message to sendsender- The command sender who will receive the message- See Also:
-
sendMessageNoPrefix
Same assendMessage(String, CommandSender)but without the prefix -
broadcast
Send a message to all players on the server, formatted automatically- Parameters:
message- The message to send- See Also:
-
sendActionBar
Send an action bar to a player with formatting handled- Parameters:
message- The action bar message to sendplayer- The player to show the bar to- See Also:
-
broadcastActionBar
-
sendList
protected <T> int sendList(Set<T> set, int entriesPerPage, int page, org.bukkit.command.CommandSender sender) -
sendList
protected <T> int sendList(List<T> list, int entriesPerPage, int page, org.bukkit.command.CommandSender sender)
-