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 TypeMethodDescriptionvoid
Adds 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.boolean
hasPermission
(String permission) Checks if the command sender has the specified permission.static @NotNull BungeeCordCommandSender
Creates a BungeeCordCommandSender object from the given sender.void
removeGroups
(String... strings) Removes the specified groups from the command sender.void
sendMessage
(String string) Sends a message to the command sender.void
sendMessage
(String... strings) Sends a message or multiple messages to the command sender.void
sendMessage
(UUID uuid, String string) Sends a message to the player with the given UUID.void
sendMessage
(UUID uuid, String... strings) Sends a message or multiple messages to the command sender.void
sendMessage
(net.md_5.bungee.api.chat.BaseComponent baseComponent) Sends a message to the command sender.void
sendMessage
(net.md_5.bungee.api.chat.BaseComponent... baseComponents) Overrides the sendMessage method of the BaseCommandSender class to send multiple messages using BaseComponent.void
sendMessages
(String @NotNull ... strings) Sends multiple messages to the command sender.void
setPermission
(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:
sendMessages
in 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:
sendMessage
in 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:
sendMessage
in 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:
getGroups
in 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:
addGroups
in interfacenet.md_5.bungee.api.CommandSender
- Parameters:
strings
- the groups to be added
-
removeGroups
Removes the specified groups from the command sender.- Specified by:
removeGroups
in interfacenet.md_5.bungee.api.CommandSender
- Parameters:
strings
- the groups to be removed
-
setPermission
Sets a permission for the command sender.- Specified by:
setPermission
in 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:
getPermissions
in 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:
sendMessage
in interfacenet.md_5.bungee.api.CommandSender
- Specified by:
sendMessage
in classBaseCommandSender
- Parameters:
string
- the message to be sent
-
sendMessage
Sends a message or multiple messages to the command sender.- Specified by:
sendMessage
in 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:
sendMessage
in 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:
sendMessage
in 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:
hasPermission
in interfacenet.md_5.bungee.api.CommandSender
- Specified by:
hasPermission
in 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:
getName
in interfacenet.md_5.bungee.api.CommandSender
- Specified by:
getName
in classBaseCommandSender
- Returns:
- the name of the command sender
-
getSenderType
Retrieves the type of the command sender.- Specified by:
getSenderType
in classBaseCommandSender
- Returns:
- The CommandSenderType representing the type of the command sender.
-