Interface CommandSenderWrapper
CommandSender that extends to functionalities, such as forcing all permissions and allows the use of remote players RemotePlayer.
 It does this by wrapping those instances.
 This is for instance used in commands to permit the remote execution.
- 
Method SummaryModifier and TypeMethodDescription@Nullable PlayerReturns thePlayerthat is being wrapped.Returns theCommandSenderthat is being wrapped.getName()Remotes the name of the sender.Returns the object that's being referenced.@Nullable RemotePlayerReturns theRemotePlayerthat is being wrapped.@Nullable UUIDRemotes the uuid of the sender.booleanhasPermission(String name) Returns whether the sender has a given permission.booleanhasPermission(Permission perm) Returns whether the sender has a given permission.booleanReturns whether an online player executed this.booleanReturns whether it was the console that executed the command.booleanisLocal()Returns whether this object is wrapping a sender this is located on this server.booleanisPlayer()Returns whether it was a player who executed the command.booleanisRemote()Returns whether this object is wrapping a sender this is located on another server.booleanReturns whether it's a player on a remote server.voidsendMessage(String message) Sends a message to the sender.voidsendMessage(String... messages) Sends multiple messages to the sender.voidsendMessage(net.md_5.bungee.api.chat.BaseComponent... components) Sends a single message that persists of the following components.static CommandSenderWrapperwrap(RemotePlayer player) Constructs a new instance with a reference of the given player.static CommandSenderWrapperwrap(CommandSender sender) Constructs a new instance with a reference of the given sender.static CommandSenderWrapperwrap(CommandSender sender, boolean hasOP) Constructs a new instance with a reference of the given sender.static CommandSenderWrapperwrapConsole(RemoteServer server) Wraps the console of the given server.
- 
Method Details- 
getNameString getName()Remotes the name of the sender.For Bukkit Players: CommandSender.getName()
 For Remote Players:RemotePlayer.getName()
 For Console: Console- Returns:
- The name of the sender
 
- 
getUniqueIdRemotes the uuid of the sender. May benullif it's not supported for the type.For Bukkit Players: Entity.getUniqueId()
 For Remote Players:RemotePlayer.getUniqueId()- Returns:
- The uuid of the reference, might be null
 
- 
isBukkitPlayerboolean isBukkitPlayer()Returns whether an online player executed this.If this method returns true, you may usegetBukkitPlayer().- Returns:
- Returns truewhen an actualPlayeris being referenced.
 
- 
isRemotePlayerboolean isRemotePlayer()Returns whether it's a player on a remote server.If this method returns true, you may usegetRemotePlayer().- Returns:
- Returns truewhen an actualRemotePlayeris being referenced.
 
- 
isConsoleboolean isConsole()Returns whether it was the console that executed the command.- Returns:
- Returns truewhen a console is the sender (either remotely and local)
 
- 
isPlayerboolean isPlayer()Returns whether it was a player who executed the command.- Returns:
- Returns truewhen a player is the sender (either remotely and local)
 
- 
isLocalboolean isLocal()Returns whether this object is wrapping a sender this is located on this server.- Returns:
- Returns truewhen the sender is located on this server
 
- 
isRemoteboolean isRemote()Returns whether this object is wrapping a sender this is located on another server.- Returns:
- Returns truewhen the sender is located on another server
 
- 
getReferenceObject getReference()Returns the object that's being referenced. This may be aCommandSenderor aRemotePlayer.- Returns:
- The instance that's being wrapped
 
- 
getCommandSenderCommandSender getCommandSender()Returns theCommandSenderthat is being wrapped.Returns nullwhen it is not being wrapped.- Returns:
- The CommandSenderthat is being wrapped. May benull
 
- 
getBukkitPlayerReturns thePlayerthat is being wrapped.Returns nullwhen the player is not on this server or when it's not a player.- Returns:
- The Playerthat is being wrapped. May benull
 
- 
getRemotePlayerReturns theRemotePlayerthat is being wrapped.Returns nullwhen the player is not on a remote server.- Returns:
- The RemotePlayerthat is being wrapped. May benull
 
- 
sendMessageSends a message to the sender.For Bukkit Players: CommandSender.sendMessage(String)()}
 For Remote Players:RemotePlayer.sendMessage(String...)()}- Parameters:
- message- The message that shall be sent
 
- 
sendMessageSends multiple messages to the sender.For Bukkit Players: CommandSender.sendMessage(String[])()}
 For Remote Players:RemotePlayer.sendMessage(String...)()}- Parameters:
- messages- The messages that shall be sent
 
- 
sendMessagevoid sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) Sends a single message that persists of the following components.For Bukkit Players: Player.Spigot.sendMessage(BaseComponent...)()}
 For Bukkit Misc (only text):CommandSender.sendMessage(String)()}
 For Remote Players:RemotePlayer.sendMessage(BaseComponent...)()}- Parameters:
- components- The components the chat message persists of
 
- 
hasPermissionReturns whether the sender has a given permission.For Bukkit Players: Permissible.hasPermission(String)()} (Or whenhasOPis true: Always true)
 For Remote Players: Always true- Parameters:
- name- The permission that shall be checked
 
- 
hasPermissionReturns whether the sender has a given permission.For Bukkit Players: Permissible.hasPermission(Permission)()} (Or whenhasOPis true: Always true)
 For Remote Players: Always true- Parameters:
- perm- The permission that shall be checked
 
- 
wrapConstructs a new instance with a reference of the given sender.- Parameters:
- sender- The sender that shall be wrapped
- Returns:
- The wrapped sender
 
- 
wrapConstructs a new instance with a reference of the given sender.- Parameters:
- sender- The sender that shall be wrapped
- hasOP-- true:- hasPermission(String)always return true;- false: uses- Permissible.hasPermission(String)
- Returns:
- The wrapped sender
 
- 
wrapConstructs a new instance with a reference of the given player.- Parameters:
- player- The player that shall be wrapped
- Returns:
- The wrapped player
 
- 
wrapConsoleWraps the console of the given server.- Parameters:
- server- The server of which the console shall be wrapped
- Returns:
- The wrapped console
 
 
-