public interface VelocityCommandActor
extends revxrsal.commands.command.CommandActor
CommandActor that wraps CommandSource| Modifier and Type | Method and Description |
|---|---|
default @Nullable com.velocitypowered.api.proxy.Player |
asPlayer()
Returns this actor as a
Player if it is a player,
otherwise returns null. |
void |
error(@NotNull net.kyori.adventure.text.ComponentLike message)
Sends the given component to this error.
|
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<VelocityCommandActor> |
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)
Sends the given component to this actor.
|
default @NotNull com.velocitypowered.api.proxy.ConsoleCommandSource |
requireConsole()
Returns this actor as a
ConsoleCommandSource if it is the console,
otherwise throws a SenderNotConsoleException. |
default @NotNull com.velocitypowered.api.proxy.Player |
requirePlayer()
Returns this actor as a
Player if it is a player,
otherwise throws a SenderNotPlayerException. |
default void |
sendRawError(@NotNull net.kyori.adventure.text.ComponentLike message)
Prints the given component to this actor as an error.
|
default void |
sendRawError(@NotNull java.lang.String message)
Sends the given message to the actor as an error, with legacy color-coding.
|
default void |
sendRawMessage(@NotNull net.kyori.adventure.text.ComponentLike message)
Prints the given component to this actor.
|
default void |
sendRawMessage(@NotNull java.lang.String message)
Sends the given message to the actor, with legacy color-coding.
|
@NotNull com.velocitypowered.api.command.CommandSource |
source()
Returns the underlying
CommandSource of this actor |
@NotNull @NotNull com.velocitypowered.api.command.CommandSource source()
CommandSource of this actordefault boolean isPlayer()
default boolean isConsole()
@Nullable default @Nullable com.velocitypowered.api.proxy.Player asPlayer()
Player if it is a player,
otherwise returns null.@NotNull
default @NotNull com.velocitypowered.api.proxy.Player requirePlayer()
throws SenderNotPlayerException
Player if it is a player,
otherwise throws a SenderNotPlayerException.SenderNotPlayerException - if not a player@NotNull
default @NotNull com.velocitypowered.api.proxy.ConsoleCommandSource requireConsole()
throws SenderNotConsoleException
ConsoleCommandSource if it is the console,
otherwise throws a SenderNotConsoleException.SenderNotPlayerException - if not a consoleSenderNotConsoleExceptionvoid reply(@NotNull
@NotNull net.kyori.adventure.text.ComponentLike message)
Note that this may be delegated to an underlying MessageSender,
as specified in an ActorFactory.
message - The message to sendvoid error(@NotNull
@NotNull net.kyori.adventure.text.ComponentLike message)
Note that this may be delegated to an underlying MessageSender,
as specified in an ActorFactory.
message - The message to senddefault void sendRawMessage(@NotNull
@NotNull net.kyori.adventure.text.ComponentLike message)
Audience.sendMessage(Component)
directlymessage - The message to senddefault void sendRawError(@NotNull
@NotNull net.kyori.adventure.text.ComponentLike message)
Audience.sendMessage(Component)
directlymessage - The message to senddefault void sendRawMessage(@NotNull
@NotNull java.lang.String message)
This function does
not delegate sending, but invokes Audience.sendMessage(Component)
directly
sendRawMessage in interface revxrsal.commands.command.CommandActormessage - Message to senddefault void sendRawError(@NotNull
@NotNull java.lang.String message)
This function does
not delegate sending, but invokes Audience.sendMessage(Component)
directly
sendRawError in interface revxrsal.commands.command.CommandActormessage - Message to sendrevxrsal.commands.Lamp<VelocityCommandActor> 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