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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable Player
Returns thePlayer
that is being wrapped.Returns theCommandSender
that is being wrapped.getName()
Remotes the name of the sender.Returns the object that's being referenced.@Nullable RemotePlayer
Returns theRemotePlayer
that is being wrapped.@Nullable UUID
Remotes the uuid of the sender.boolean
hasPermission
(String name) Returns whether the sender has a given permission.boolean
hasPermission
(Permission perm) Returns whether the sender has a given permission.boolean
Returns whether an online player executed this.boolean
Returns whether it was the console that executed the command.boolean
isLocal()
Returns whether this object is wrapping a sender this is located on this server.boolean
isPlayer()
Returns whether it was a player who executed the command.boolean
isRemote()
Returns whether this object is wrapping a sender this is located on another server.boolean
Returns whether it's a player on a remote server.void
sendMessage
(String message) Sends a message to the sender.void
sendMessage
(String... messages) Sends multiple messages to the sender.void
sendMessage
(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:CommandSenderWrapper
Remotes the name of the sender.For Bukkit Players:
CommandSender.getName()
For Remote Players:RemotePlayer.getName()
For Console: Console- Specified by:
getName
in interfaceCommandSenderWrapper
- Returns:
- The name of the sender
-
getUniqueId
Description copied from interface:CommandSenderWrapper
Remotes the uuid of the sender. May benull
if it's not supported for the type.For Bukkit Players:
Entity.getUniqueId()
For Remote Players:RemotePlayer.getUniqueId()
- Specified by:
getUniqueId
in interfaceCommandSenderWrapper
- Returns:
- The uuid of the reference, might be
null
-
isBukkitPlayer
public boolean isBukkitPlayer()Description copied from interface:CommandSenderWrapper
Returns whether an online player executed this.If this method returns
true
, you may useCommandSenderWrapper.getBukkitPlayer()
.- Specified by:
isBukkitPlayer
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when an actualPlayer
is being referenced.
-
isRemotePlayer
public boolean isRemotePlayer()Description copied from interface:CommandSenderWrapper
Returns whether it's a player on a remote server.If this method returns
true
, you may useCommandSenderWrapper.getRemotePlayer()
.- Specified by:
isRemotePlayer
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when an actualRemotePlayer
is being referenced.
-
isConsole
public boolean isConsole()Description copied from interface:CommandSenderWrapper
Returns whether it was the console that executed the command.- Specified by:
isConsole
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when a console is the sender (either remotely and local)
-
isPlayer
public boolean isPlayer()Description copied from interface:CommandSenderWrapper
Returns whether it was a player who executed the command.- Specified by:
isPlayer
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when a player is the sender (either remotely and local)
-
isLocal
public boolean isLocal()Description copied from interface:CommandSenderWrapper
Returns whether this object is wrapping a sender this is located on this server.- Specified by:
isLocal
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when the sender is located on this server
-
isRemote
public boolean isRemote()Description copied from interface:CommandSenderWrapper
Returns whether this object is wrapping a sender this is located on another server.- Specified by:
isRemote
in interfaceCommandSenderWrapper
- Returns:
- Returns
true
when the sender is located on another server
-
getReference
Description copied from interface:CommandSenderWrapper
Returns the object that's being referenced. This may be aCommandSender
or aRemotePlayer
.- Specified by:
getReference
in interfaceCommandSenderWrapper
- Returns:
- The instance that's being wrapped
-
getCommandSender
Description copied from interface:CommandSenderWrapper
Returns theCommandSender
that is being wrapped.Returns
null
when it is not being wrapped.- Specified by:
getCommandSender
in interfaceCommandSenderWrapper
- Returns:
- The
CommandSender
that is being wrapped. May benull
-
getBukkitPlayer
Description copied from interface:CommandSenderWrapper
Returns thePlayer
that is being wrapped.Returns
null
when the player is not on this server or when it's not a player.- Specified by:
getBukkitPlayer
in interfaceCommandSenderWrapper
- Returns:
- The
Player
that is being wrapped. May benull
-
getRemotePlayer
Description copied from interface:CommandSenderWrapper
Returns theRemotePlayer
that is being wrapped.Returns
null
when the player is not on a remote server.- Specified by:
getRemotePlayer
in interfaceCommandSenderWrapper
- Returns:
- The
RemotePlayer
that is being wrapped. May benull
-
sendMessage
Description copied from interface:CommandSenderWrapper
Sends a message to the sender.For Bukkit Players:
CommandSender.sendMessage(String)
()}
For Remote Players:RemotePlayer.sendMessage(String...)
()}- Specified by:
sendMessage
in interfaceCommandSenderWrapper
- Parameters:
message
- The message that shall be sent
-
sendMessage
Description copied from interface:CommandSenderWrapper
Sends multiple messages to the sender.For Bukkit Players:
CommandSender.sendMessage(String[])
()}
For Remote Players:RemotePlayer.sendMessage(String...)
()}- Specified by:
sendMessage
in 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:CommandSenderWrapper
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...)
()}- Specified by:
sendMessage
in interfaceCommandSenderWrapper
- Parameters:
components
- The components the chat message persists of
-
hasPermission
Description copied from interface:CommandSenderWrapper
Returns whether the sender has a given permission.For Bukkit Players:
Permissible.hasPermission(String)
()} (Or whenhasOP
is true: Always true)
For Remote Players: Always true- Specified by:
hasPermission
in interfaceCommandSenderWrapper
- Parameters:
name
- The permission that shall be checked
-
hasPermission
Description copied from interface:CommandSenderWrapper
Returns whether the sender has a given permission.For Bukkit Players:
Permissible.hasPermission(Permission)
()} (Or whenhasOP
is true: Always true)
For Remote Players: Always true- Specified by:
hasPermission
in interfaceCommandSenderWrapper
- Parameters:
perm
- The permission that shall be checked
-
equals
-