Interface CommandSender
public interface CommandSender
Represents an entity that can send commands.
-
Method Summary
Modifier and TypeMethodDescriptionvoidSends an error message to the sender.voidSends an error message to the sender.Returns the audience of this command sender.Returns the locale of this command sender.getName()Returns the name of this command sender.Returns the permissions of this command sender.mindustry.gen.PlayerReturns the player of this command sender.booleanisPlayer()Returns whether this sender is a player.booleanisServer()Returns whether this sender is the server.static CommandSenderplayer(mindustry.gen.Player player) Wraps a player into a command sender.voidSends a message to the sender.voidSends a message to the sender.static CommandSenderserver()Returns the server itself as a command sender.
-
Method Details
-
player
Wraps a player into a command sender.- Parameters:
player- the player to wrap- Returns:
- the player command sender
-
server
Returns the server itself as a command sender. -
getName
String getName()Returns the name of this command sender. -
reply
Sends a message to the sender.- Parameters:
text- the message to send
-
reply
Sends a message to the sender.- Parameters:
component- the message to send
-
error
Sends an error message to the sender.- Parameters:
text- the message to send
-
error
Sends an error message to the sender.- Parameters:
component- the message to send
-
isPlayer
boolean isPlayer()Returns whether this sender is a player. -
isServer
boolean isServer()Returns whether this sender is the server. -
getPlayer
mindustry.gen.Player getPlayer()Returns the player of this command sender.- Returns:
- the player of this command sender
- Throws:
UnsupportedOperationException- if this sender is not a player
-
getPermissions
PermissionProvider getPermissions()Returns the permissions of this command sender. -
getLocale
Locale getLocale()Returns the locale of this command sender. -
getAudience
Audience getAudience()Returns the audience of this command sender.
-