Class BungeeCordCommandSender
java.lang.Object
me.github.simonplays15.betterbansystem.core.player.BaseCommandSender
me.github.simonplays15.betterbansystem.core.player.BungeeCordCommandSender
- All Implemented Interfaces:
net.md_5.bungee.api.CommandSender
public class BungeeCordCommandSender
extends BaseCommandSender
implements net.md_5.bungee.api.CommandSender
The BungeeCordCommandSender class extends the BaseCommandSender class and represents
a BungeeCord command sender.
It provides methods for sending messages, checking permissions, and getting the name and type of the
sender.
-
Constructor Summary
ConstructorsConstructorDescriptionBungeeCordCommandSender(Object sender) BungeeCordCommandSender represents a command sender in the BungeeCord API.BungeeCordCommandSender(net.md_5.bungee.api.CommandSender sender) The BungeeCordCommandSender class represents a command sender in the BungeeCord API. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified groups to the command sender.Retrieves the groups associated with the command sender.getName()Retrieves the name of the command sender.Retrieves the permissions of the command sender.Retrieves the type of the command sender.booleanhasPermission(String permission) Checks if the command sender has the specified permission.static @NotNull BungeeCordCommandSenderCreates a BungeeCordCommandSender object from the given sender.voidremoveGroups(String... strings) Removes the specified groups from the command sender.voidsendMessage(String string) Sends a message to the command sender.voidsendMessage(String... strings) Sends a message or multiple messages to the command sender.voidsendMessage(UUID uuid, String string) Sends a message to the player with the given UUID.voidsendMessage(UUID uuid, String... strings) Sends a message or multiple messages to the command sender.voidsendMessage(net.md_5.bungee.api.chat.BaseComponent baseComponent) Sends a message to the command sender.voidsendMessage(net.md_5.bungee.api.chat.BaseComponent... baseComponents) Overrides the sendMessage method of the BaseCommandSender class to send multiple messages using BaseComponent.voidsendMessages(String @NotNull ... strings) Sends multiple messages to the command sender.voidsetPermission(String permission, boolean value) Sets a permission for the command sender.Methods inherited from class me.github.simonplays15.betterbansystem.core.player.BaseCommandSender
isBlock, isConsole, isOther, isPlayer
-
Constructor Details
-
BungeeCordCommandSender
public BungeeCordCommandSender(net.md_5.bungee.api.CommandSender sender) The BungeeCordCommandSender class represents a command sender in the BungeeCord API. It extends the BaseCommandSender abstract class. -
BungeeCordCommandSender
BungeeCordCommandSender represents a command sender in the BungeeCord API. It extends the BaseCommandSender class and provides methods for sending messages, checking permissions , getting the name of the sender, and determining the type of sender.
-
-
Method Details
-
of
Creates a BungeeCordCommandSender object from the given sender.- Parameters:
sender- the CommandSender object- Returns:
- the BungeeCordCommandSender object
- Throws:
IllegalArgumentException- if the sender type is not supported
-
sendMessages
Sends multiple messages to the command sender.- Specified by:
sendMessagesin interfacenet.md_5.bungee.api.CommandSender- Parameters:
strings- the messages to be sent- Throws:
IllegalArgumentException- if any of the messages is null
-
sendMessage
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... baseComponents) Overrides the sendMessage method of the BaseCommandSender class to send multiple messages using BaseComponent.- Specified by:
sendMessagein interfacenet.md_5.bungee.api.CommandSender- Parameters:
baseComponents- the BaseComponent messages to be sent
-
sendMessage
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent baseComponent) Sends a message to the command sender.- Specified by:
sendMessagein interfacenet.md_5.bungee.api.CommandSender- Parameters:
baseComponent- the BaseComponent to be sent as a message- Since:
- version 1.0
-
getGroups
Retrieves the groups associated with the command sender.- Specified by:
getGroupsin interfacenet.md_5.bungee.api.CommandSender- Returns:
- a Collection of strings representing the groups associated with the command sender
-
addGroups
Adds the specified groups to the command sender.- Specified by:
addGroupsin interfacenet.md_5.bungee.api.CommandSender- Parameters:
strings- the groups to be added
-
removeGroups
Removes the specified groups from the command sender.- Specified by:
removeGroupsin interfacenet.md_5.bungee.api.CommandSender- Parameters:
strings- the groups to be removed
-
setPermission
Sets a permission for the command sender.- Specified by:
setPermissionin interfacenet.md_5.bungee.api.CommandSender- Parameters:
permission- the permission to be setvalue- true if the permission is granted, false if it is denied
-
getPermissions
Retrieves the permissions of the command sender.- Specified by:
getPermissionsin interfacenet.md_5.bungee.api.CommandSender- Returns:
- a Collection of strings representing the permissions of the command sender
-
sendMessage
Sends a message to the command sender.- Specified by:
sendMessagein interfacenet.md_5.bungee.api.CommandSender- Specified by:
sendMessagein classBaseCommandSender- Parameters:
string- the message to be sent
-
sendMessage
Sends a message or multiple messages to the command sender.- Specified by:
sendMessagein classBaseCommandSender- Parameters:
strings- the messages to be sent to the command sender
-
sendMessage
Sends a message to the player with the given UUID. If the UUID is null, the message is sent to the console.- Specified by:
sendMessagein classBaseCommandSender- Parameters:
uuid- The UUID of the player to send the message to. Can be null for console.string- The message to send.
-
sendMessage
Sends a message or multiple messages to the command sender.- Specified by:
sendMessagein classBaseCommandSender- Parameters:
uuid- the UUID of the recipientstrings- the string message(s) to send
-
hasPermission
Checks if the command sender has the specified permission.- Specified by:
hasPermissionin interfacenet.md_5.bungee.api.CommandSender- Specified by:
hasPermissionin classBaseCommandSender- Parameters:
permission- the permission to check- Returns:
- true if the command sender has the permission, false otherwise
-
getName
Retrieves the name of the command sender.- Specified by:
getNamein interfacenet.md_5.bungee.api.CommandSender- Specified by:
getNamein classBaseCommandSender- Returns:
- the name of the command sender
-
getSenderType
Retrieves the type of the command sender.- Specified by:
getSenderTypein classBaseCommandSender- Returns:
- The CommandSenderType representing the type of the command sender.
-