Package cloud.commandframework.bukkit
Class BukkitCommandSender
java.lang.Object
cloud.commandframework.bukkit.BukkitCommandSender
Command sender that proxies
CommandSender-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBukkitCommandSender(@NonNull org.bukkit.command.CommandSender internalSender) Create a new command sender from a BukkitCommandSender -
Method Summary
Modifier and TypeMethodDescriptionabstract @NonNull org.bukkit.entity.PlayerasPlayer()Get this sender as a player.static @NonNull BukkitCommandSenderconsole()Construct a newBukkitCommandSenderfor the Bukkit consolefinal boolean@NonNull org.bukkit.command.CommandSenderGet the proxiedCommandSenderfinal inthashCode()abstract booleanisPlayer()Check if this sender represents a playerstatic @NonNull BukkitCommandSenderof(@NonNull org.bukkit.command.CommandSender sender) Construct a newBukkitCommandSenderfrom a BukkitCommandSenderstatic @NonNull BukkitCommandSenderplayer(@NonNull org.bukkit.entity.Player player) Construct a newBukkitCommandSenderfor aPlayervoidsendMessage(@NonNull String message) Send a message to the command sender
-
Constructor Details
-
BukkitCommandSender
protected BukkitCommandSender(@NonNull org.bukkit.command.CommandSender internalSender) Create a new command sender from a BukkitCommandSender- Parameters:
internalSender- Bukkit command sender
-
-
Method Details
-
player
Construct a newBukkitCommandSenderfor aPlayer- Parameters:
player- Player instance- Returns:
- Constructed command sender
-
console
Construct a newBukkitCommandSenderfor the Bukkit console- Returns:
- Constructed command sender
-
of
Construct a newBukkitCommandSenderfrom a BukkitCommandSender- Parameters:
sender- Bukkit command sender- Returns:
- Constructed command sender
-
equals
-
hashCode
public final int hashCode() -
getInternalSender
public @NonNull org.bukkit.command.CommandSender getInternalSender()Get the proxiedCommandSender- Returns:
- Proxied command sneder
-
isPlayer
public abstract boolean isPlayer()Check if this sender represents a player- Returns:
trueif this sender represents a player,falseif not
-
asPlayer
public abstract @NonNull org.bukkit.entity.Player asPlayer()Get this sender as a player. This can only safely be done ifisPlayer()} returnstrue- Returns:
- Player object
-
sendMessage
Send a message to the command sender- Parameters:
message- Message to send
-