CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
A simple representation of Minecraft's CommandListenerWrapper, in the form of Bukkit's ProxiedCommandSender. More...
Public Member Functions | |
NativeProxyCommandSender (CommandSender caller, CommandSender callee, Location location, World world) | |
Constructs a NativeProxyCommandSender, which is basically Minecraft's CommandListenerWrapper. More... | |
PermissionAttachment | addAttachment (Plugin plugin) |
Adds a new empty PermissionAttachment to this object. More... | |
PermissionAttachment | addAttachment (Plugin plugin, int ticks) |
Temporarily adds a new empty PermissionAttachment to this object. More... | |
PermissionAttachment | addAttachment (Plugin plugin, String name, boolean value) |
Adds a new PermissionAttachment with a single permission by name and value. More... | |
PermissionAttachment | addAttachment (Plugin plugin, String name, boolean value, int ticks) |
Temporarily adds a new PermissionAttachment with a single permission by name and value. More... | |
CommandSender | getCallee () |
Returns the CommandSender which is being used to call the command. More... | |
CommandSender | getCaller () |
Returns the CommandSender which triggered this proxied command. More... | |
Set< PermissionAttachmentInfo > | getEffectivePermissions () |
Gets a set containing all of the permissions currently in effect by this object. More... | |
Location | getLocation () |
Returns the location that this native command sender represents. More... | |
String | getName () |
Gets the name of this command sender. More... | |
Server | getServer () |
Returns the server instance that this command is running on. More... | |
World | getWorld () |
Returns the world that this native command sender represents. More... | |
boolean | hasPermission (Permission perm) |
Gets the value of the specified permission, if set. More... | |
boolean | hasPermission (String name) |
Gets the value of the specified permission, if set. More... | |
boolean | isOp () |
Checks if this object is a server operator. More... | |
boolean | isPermissionSet (Permission perm) |
Checks if this object contains an override for the specified Permission. More... | |
boolean | isPermissionSet (String name) |
Checks if this object contains an override for the specified permission, by fully qualified name. More... | |
void | recalculatePermissions () |
Recalculates the permissions for this object, if the attachments have changed values. More... | |
void | removeAttachment (PermissionAttachment attachment) |
Removes the given PermissionAttachment from this object. More... | |
void | sendMessage (String message) |
Sends this sender a message. More... | |
void | sendMessage (String... messages) |
Sends this sender multiple messages. More... | |
void | sendMessage (UUID sender, String message) |
Sends this sender a message. More... | |
void | sendMessage (UUID sender, String... messages) |
Sends this sender multiple messages. More... | |
void | setOp (boolean value) |
Sets the operator status of this object. More... | |
Spigot | spigot () |
Returns a Spigot instance of this object. More... | |
Component | name () |
A simple representation of Minecraft's CommandListenerWrapper, in the form of Bukkit's ProxiedCommandSender.
dev.jorel.commandapi.wrappers.NativeProxyCommandSender.NativeProxyCommandSender | ( | CommandSender | caller, |
CommandSender | callee, | ||
Location | location, | ||
World | world | ||
) |
Constructs a NativeProxyCommandSender, which is basically Minecraft's CommandListenerWrapper.
caller | the command sender that actually sent the command |
callee | the command sender that will be executing the command |
location | the proxied location that the command will be run at |
world | the proxied world that the command will be run in |
PermissionAttachment dev.jorel.commandapi.wrappers.NativeProxyCommandSender.addAttachment | ( | Plugin | plugin | ) |
Adds a new empty PermissionAttachment to this object.
plugin | Plugin responsible for this attachment, may not be null or disabled |
PermissionAttachment dev.jorel.commandapi.wrappers.NativeProxyCommandSender.addAttachment | ( | Plugin | plugin, |
int | ticks | ||
) |
Temporarily adds a new empty PermissionAttachment to this object.
plugin | Plugin responsible for this attachment, may not be null or disabled |
ticks | Amount of ticks to automatically remove this attachment after |
PermissionAttachment dev.jorel.commandapi.wrappers.NativeProxyCommandSender.addAttachment | ( | Plugin | plugin, |
String | name, | ||
boolean | value | ||
) |
Adds a new PermissionAttachment with a single permission by name and value.
plugin | Plugin responsible for this attachment, may not be null or disabled |
name | Name of the permission to attach |
value | Value of the permission |
PermissionAttachment dev.jorel.commandapi.wrappers.NativeProxyCommandSender.addAttachment | ( | Plugin | plugin, |
String | name, | ||
boolean | value, | ||
int | ticks | ||
) |
Temporarily adds a new PermissionAttachment with a single permission by name and value.
plugin | Plugin responsible for this attachment, may not be null or disabled |
name | Name of the permission to attach |
value | Value of the permission |
ticks | Amount of ticks to automatically remove this attachment after |
CommandSender dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getCallee | ( | ) |
Returns the CommandSender which is being used to call the command.
CommandSender dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getCaller | ( | ) |
Returns the CommandSender which triggered this proxied command.
Set< PermissionAttachmentInfo > dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getEffectivePermissions | ( | ) |
Gets a set containing all of the permissions currently in effect by this object.
Location dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getLocation | ( | ) |
Returns the location that this native command sender represents.
String dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getName | ( | ) |
Gets the name of this command sender.
Server dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getServer | ( | ) |
Returns the server instance that this command is running on.
World dev.jorel.commandapi.wrappers.NativeProxyCommandSender.getWorld | ( | ) |
Returns the world that this native command sender represents.
boolean dev.jorel.commandapi.wrappers.NativeProxyCommandSender.hasPermission | ( | Permission | perm | ) |
Gets the value of the specified permission, if set.
If a permission override is not set on this object, the default value of the permission will be returned
perm | Permission to get |
boolean dev.jorel.commandapi.wrappers.NativeProxyCommandSender.hasPermission | ( | String | name | ) |
Gets the value of the specified permission, if set.
If a permission override is not set on this object, the default value of the permission will be returned.
name | Name of the permission |
boolean dev.jorel.commandapi.wrappers.NativeProxyCommandSender.isOp | ( | ) |
Checks if this object is a server operator.
boolean dev.jorel.commandapi.wrappers.NativeProxyCommandSender.isPermissionSet | ( | Permission | perm | ) |
Checks if this object contains an override for the specified Permission.
perm | Permission to check |
boolean dev.jorel.commandapi.wrappers.NativeProxyCommandSender.isPermissionSet | ( | String | name | ) |
Checks if this object contains an override for the specified permission, by fully qualified name.
name | Name of the permission |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.recalculatePermissions | ( | ) |
Recalculates the permissions for this object, if the attachments have changed values.
This should very rarely need to be called from a plugin.
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.removeAttachment | ( | PermissionAttachment | attachment | ) |
Removes the given PermissionAttachment from this object.
attachment | Attachment to remove |
IllegalArgumentException | Thrown when the specified attachment isn't part of this object |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.sendMessage | ( | String | message | ) |
Sends this sender a message.
message | Message to be displayed |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.sendMessage | ( | String... | messages | ) |
Sends this sender multiple messages.
messages | An array of messages to be displayed |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.sendMessage | ( | UUID | sender, |
String | message | ||
) |
Sends this sender a message.
message | Message to be displayed |
sender | The sender of this message |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.sendMessage | ( | UUID | sender, |
String... | messages | ||
) |
Sends this sender multiple messages.
messages | An array of messages to be displayed |
sender | The sender of this message |
void dev.jorel.commandapi.wrappers.NativeProxyCommandSender.setOp | ( | boolean | value | ) |
Sets the operator status of this object.
value | New operator value |
Spigot dev.jorel.commandapi.wrappers.NativeProxyCommandSender.spigot | ( | ) |
Returns a Spigot instance of this object.