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 StringgetName()Retrieves the name of the command sender.abstract CommandSenderTypeRetrieves the type of the command sender.abstract booleanhasPermission(String permission) Checks if the command sender has the specified permission.booleanisBlock()Checks if the command sender is a block.booleanChecks if the command sender is a console.booleanisOther()Checks if the sender type is OTHER.booleanisPlayer()Determines whether the command sender is a player.abstract voidsendMessage(String string) Sends a message to the command sender.abstract voidsendMessage(String... strings) Sends a message or multiple messages to the command sender.abstract voidsendMessage(UUID uuid, String string) Sends a message to the player with the given UUID.abstract voidsendMessage(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.
-