Class CommandSenderWrapper.RemotePlayerWrapper
- All Implemented Interfaces:
CommandSenderWrapper
- Enclosing interface:
CommandSenderWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.marcely.bedwars.tools.CommandSenderWrapper
CommandSenderWrapper.BukkitWrapper, CommandSenderWrapper.RemoteConsoleWrapper, CommandSenderWrapper.RemotePlayerWrapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@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.
-
Constructor Details
-
RemotePlayerWrapper
public RemotePlayerWrapper()
-
-
Method Details
-
getName
Description copied from interface:CommandSenderWrapperRemotes the name of the sender.For Bukkit Players:
CommandSender.getName()
For Remote Players:RemotePlayer.getName()
For Console: Console- Specified by:
getNamein interfaceCommandSenderWrapper- Returns:
- The name of the sender
-
getUniqueId
Description copied from interface:CommandSenderWrapperRemotes the uuid of the sender. May benullif it's not supported for the type.For Bukkit Players:
Entity.getUniqueId()
For Remote Players:RemotePlayer.getUniqueId()- Specified by:
getUniqueIdin interfaceCommandSenderWrapper- Returns:
- The uuid of the reference, might be
null
-
isBukkitPlayer
public boolean isBukkitPlayer()Description copied from interface:CommandSenderWrapperReturns whether an online player executed this.If this method returns
true, you may useCommandSenderWrapper.getBukkitPlayer().- Specified by:
isBukkitPlayerin interfaceCommandSenderWrapper- Returns:
- Returns
truewhen an actualPlayeris being referenced.
-
isRemotePlayer
public boolean isRemotePlayer()Description copied from interface:CommandSenderWrapperReturns whether it's a player on a remote server.If this method returns
true, you may useCommandSenderWrapper.getRemotePlayer().- Specified by:
isRemotePlayerin interfaceCommandSenderWrapper- Returns:
- Returns
truewhen an actualRemotePlayeris being referenced.
-
isConsole
public boolean isConsole()Description copied from interface:CommandSenderWrapperReturns whether it was the console that executed the command.- Specified by:
isConsolein interfaceCommandSenderWrapper- Returns:
- Returns
truewhen a console is the sender (either remotely and local)
-
isPlayer
public boolean isPlayer()Description copied from interface:CommandSenderWrapperReturns whether it was a player who executed the command.- Specified by:
isPlayerin interfaceCommandSenderWrapper- Returns:
- Returns
truewhen a player is the sender (either remotely and local)
-
isLocal
public boolean isLocal()Description copied from interface:CommandSenderWrapperReturns whether this object is wrapping a sender this is located on this server.- Specified by:
isLocalin interfaceCommandSenderWrapper- Returns:
- Returns
truewhen the sender is located on this server
-
isRemote
public boolean isRemote()Description copied from interface:CommandSenderWrapperReturns whether this object is wrapping a sender this is located on another server.- Specified by:
isRemotein interfaceCommandSenderWrapper- Returns:
- Returns
truewhen the sender is located on another server
-
getReference
Description copied from interface:CommandSenderWrapperReturns the object that's being referenced. This may be aCommandSenderor aRemotePlayer.- Specified by:
getReferencein interfaceCommandSenderWrapper- Returns:
- The instance that's being wrapped
-
getCommandSender
Description copied from interface:CommandSenderWrapperReturns theCommandSenderthat is being wrapped.Returns
nullwhen it is not being wrapped.- Specified by:
getCommandSenderin interfaceCommandSenderWrapper- Returns:
- The
CommandSenderthat is being wrapped. May benull
-
getBukkitPlayer
Description copied from interface:CommandSenderWrapperReturns thePlayerthat is being wrapped.Returns
nullwhen the player is not on this server or when it's not a player.- Specified by:
getBukkitPlayerin interfaceCommandSenderWrapper- Returns:
- The
Playerthat is being wrapped. May benull
-
getRemotePlayer
Description copied from interface:CommandSenderWrapperReturns theRemotePlayerthat is being wrapped.Returns
nullwhen the player is not on a remote server.- Specified by:
getRemotePlayerin interfaceCommandSenderWrapper- Returns:
- The
RemotePlayerthat is being wrapped. May benull
-
sendMessage
Description copied from interface:CommandSenderWrapperSends a message to the sender.For Bukkit Players:
CommandSender.sendMessage(String)()}
For Remote Players:RemotePlayer.sendMessage(String...)()}- Specified by:
sendMessagein interfaceCommandSenderWrapper- Parameters:
message- The message that shall be sent
-
sendMessage
Description copied from interface:CommandSenderWrapperSends multiple messages to the sender.For Bukkit Players:
CommandSender.sendMessage(String[])()}
For Remote Players:RemotePlayer.sendMessage(String...)()}- Specified by:
sendMessagein interfaceCommandSenderWrapper- Parameters:
messages- The messages that shall be sent
-
sendMessage
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) Description copied from interface:CommandSenderWrapperSends 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...)()}- Specified by:
sendMessagein interfaceCommandSenderWrapper- Parameters:
components- The components the chat message persists of
-
hasPermission
Description copied from interface:CommandSenderWrapperReturns whether the sender has a given permission.For Bukkit Players:
Permissible.hasPermission(String)()} (Or whenhasOPis true: Always true)
For Remote Players: Always true- Specified by:
hasPermissionin interfaceCommandSenderWrapper- Parameters:
name- The permission that shall be checked
-
hasPermission
Description copied from interface:CommandSenderWrapperReturns whether the sender has a given permission.For Bukkit Players:
Permissible.hasPermission(Permission)()} (Or whenhasOPis true: Always true)
For Remote Players: Always true- Specified by:
hasPermissionin interfaceCommandSenderWrapper- Parameters:
perm- The permission that shall be checked
-
equals
-