public interface BukkitCommandActor
extends revxrsal.commands.command.CommandActor
CommandActor that wraps CommandSender| Modifier and Type | Method and Description |
|---|---|
default @Nullable org.bukkit.entity.Player |
asPlayer()
Returns this actor as a
Player if it is a player,
otherwise returns null. |
@NotNull java.util.Optional<net.kyori.adventure.audience.Audience> |
audience()
Returns this actor as an adventure
Audience. |
default boolean |
isConsole()
Tests whether is this actor the console or not
|
default boolean |
isPlayer()
Tests whether is this actor a player or not
|
revxrsal.commands.Lamp<BukkitCommandActor> |
lamp()
Returns the
Lamp instance that constructed this actor. |
default @NotNull java.lang.String |
name()
Returns the name of this actor.
|
void |
reply(@NotNull net.kyori.adventure.text.ComponentLike message)
Prints the given component to this actor.
|
default @NotNull org.bukkit.command.ConsoleCommandSender |
requireConsole()
Returns this actor as a
ConsoleCommandSender if it is a player,
otherwise throws a SenderNotConsoleException. |
default @NotNull org.bukkit.entity.Player |
requirePlayer()
Returns this actor as a
Player if it is a player,
otherwise throws a SenderNotPlayerException. |
@NotNull org.bukkit.command.CommandSender |
sender()
Returns the underlying
CommandSender of this actor |
default void |
sendRawError(@NotNull java.lang.String message)
Prints the given component to this actor as an error.
|
default void |
sendRawMessage(@NotNull java.lang.String message)
Prints the given component to this actor.
|
@NotNull @NotNull org.bukkit.command.CommandSender sender()
CommandSender of this actordefault boolean isPlayer()
default boolean isConsole()
@Nullable default @Nullable org.bukkit.entity.Player asPlayer()
Player if it is a player,
otherwise returns null.@NotNull
default @NotNull org.bukkit.entity.Player requirePlayer()
throws SenderNotPlayerException
Player if it is a player,
otherwise throws a SenderNotPlayerException.SenderNotPlayerException - if not a player@NotNull
default @NotNull org.bukkit.command.ConsoleCommandSender requireConsole()
throws SenderNotConsoleException
ConsoleCommandSender if it is a player,
otherwise throws a SenderNotConsoleException.SenderNotConsoleException - if not a consoledefault void sendRawMessage(@NotNull
@NotNull java.lang.String message)
CommandSender.sendMessage(String)
directlysendRawMessage in interface revxrsal.commands.command.CommandActormessage - The message to senddefault void sendRawError(@NotNull
@NotNull java.lang.String message)
CommandSender.sendMessage(String)
directlysendRawError in interface revxrsal.commands.command.CommandActormessage - The message to sendvoid reply(@NotNull
@NotNull net.kyori.adventure.text.ComponentLike message)
message - The message to send@NotNull @NotNull java.util.Optional<net.kyori.adventure.audience.Audience> audience()
Audience.revxrsal.commands.Lamp<BukkitCommandActor> lamp()
Lamp instance that constructed this actor.lamp in interface revxrsal.commands.command.CommandActorLamp instance@NotNull default @NotNull java.lang.String name()
name in interface revxrsal.commands.command.CommandActor