Package me.lucko.luckperms.common.sender
Interface Sender
- All Known Implementing Classes:
AbstractSender,DummyConsoleSender
public interface Sender
Wrapper interface to represent a CommandSender/CommandSource within the common command implementations.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the sender's usernamedefault StringGets a string representing the senders username, and their current location within the network.net.luckperms.api.util.TristategetPermissionValue(String permission) Gets the tristate a permission is set to.Gets the plugin instance the sender is from.Gets the sender's unique id.booleanhasPermission(String permission) Check if the Sender has a permission.default booleanhasPermission(CommandPermission permission) Check if the Sender has a permission.booleanGets whether this sender is the consoledefault booleanisValid()Gets whether this sender is still valid invalid input: '&' receiving messages.voidperformCommand(String commandLine) Makes the sender perform a command.voidsendMessage(net.kyori.adventure.text.Component message) Send a json message to the Sender.
-
Field Details
-
CONSOLE_UUID
The uuid used by the console sender. -
CONSOLE_NAME
The name used by the console sender.- See Also:
-
-
Method Details
-
getPlugin
LuckPermsPlugin getPlugin()Gets the plugin instance the sender is from.- Returns:
- the plugin
-
getName
String getName()Gets the sender's username- Returns:
- a friendly username for the sender
-
getNameWithLocation
Gets a string representing the senders username, and their current location within the network.- Returns:
- a friendly identifier for the sender
-
getUniqueId
UUID getUniqueId()Gets the sender's unique id.See
CONSOLE_UUIDfor the console's UUID representation.- Returns:
- the sender's uuid
-
sendMessage
void sendMessage(net.kyori.adventure.text.Component message) Send a json message to the Sender.- Parameters:
message- the message to send.
-
getPermissionValue
Gets the tristate a permission is set to.- Parameters:
permission- the permission to check for- Returns:
- a tristate
-
hasPermission
Check if the Sender has a permission.- Parameters:
permission- the permission to check for- Returns:
- true if the sender has the permission
-
hasPermission
Check if the Sender has a permission.- Parameters:
permission- the permission to check for- Returns:
- true if the sender has the permission
-
performCommand
Makes the sender perform a command.- Parameters:
commandLine- the command
-
isConsole
boolean isConsole()Gets whether this sender is the console- Returns:
- if the sender is the console
-
isValid
default boolean isValid()Gets whether this sender is still valid invalid input: '&' receiving messages.- Returns:
- if this sender is valid
-