Class BaseCommandSender
java.lang.Object
me.github.simonplays15.betterbansystem.core.player.BaseCommandSender
- Direct Known Subclasses:
BungeeCordCommandSender
,SpigotCommandSender
The BaseCommandSender class is an abstract class that represents a command sender. It
provides methods for sending messages,
checking permissions, getting the name of the sender, and determining the type of sender.
-
Constructor Summary
ConstructorsConstructorDescriptionThe BaseCommandSender class is an abstract class that represents a command sender. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
getName()
Retrieves the name of the command sender.abstract CommandSenderType
Retrieves the type of the command sender.abstract boolean
hasPermission
(String permission) Checks if the command sender has the specified permission.boolean
isBlock()
Checks if the command sender is a block.boolean
Checks if the command sender is a console.boolean
isOther()
Checks if the sender type is OTHER.boolean
isPlayer()
Determines whether the command sender is a player.abstract void
sendMessage
(String string) Sends a message to the command sender.abstract void
sendMessage
(String... strings) Sends a message or multiple messages to the command sender.abstract void
sendMessage
(UUID uuid, String string) Sends a message to the player with the given UUID.abstract void
sendMessage
(UUID uuid, String... strings) Sends a message to the specified UUID recipient with the provided string messages.
-
Constructor Details
-
BaseCommandSender
public BaseCommandSender()The BaseCommandSender class is an abstract class that represents a command sender. It provides methods for sending messages, checking permissions, getting the name of the sender, and determining the type of sender.
-
-
Method Details
-
sendMessage
Sends a message to the command sender.- Parameters:
string
- the message to be sent
-
sendMessage
Sends a message or multiple messages to the command sender.- 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.- 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 to the specified UUID recipient with the provided string messages.- Parameters:
uuid
- the UUID of the recipientstrings
- the string message(s) to send
-
hasPermission
Checks if the command sender has the specified permission.- 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.- Returns:
- the name of the command sender
-
getSenderType
Retrieves the type of the command sender.- Returns:
- The CommandSenderType representing the type of the command sender.
-
isConsole
public boolean isConsole()Checks if the command sender is a console.- Returns:
- true if the command sender is a console, false otherwise.
-
isPlayer
public boolean isPlayer()Determines whether the command sender is a player.- Returns:
- true if the command sender is a player, otherwise false.
-
isOther
public boolean isOther()Checks if the sender type is OTHER.- Returns:
- true if the sender type is OTHER, false otherwise.
-
isBlock
public boolean isBlock()Checks if the command sender is a block.- Returns:
- true if the command sender is a block, false otherwise.
-