Interface SpongeCommandActor

All Superinterfaces:
CommandActor
All Known Implementing Classes:
SpongeActor

public interface SpongeCommandActor extends CommandActor
Represents a Sponge CommandActor that wraps a CommandSource
  • Method Details

    • reply

      void reply(@NotNull @NotNull org.spongepowered.api.text.Text message)
      Sends a message to this receiver.

      If text formatting is not supported in the implementation it will be displayed as plain text.

      Parameters:
      message - The message
    • getSource

      @NotNull @NotNull org.spongepowered.api.command.CommandSource getSource()
      Returns the underlying CommandSource being wrapped by this actor.
      Returns:
      Velocity's command source.
    • isPlayer

      boolean isPlayer()
      Tests whether is this actor a player or not
      Returns:
      Is this a player or not
    • isConsole

      boolean isConsole()
      Tests whether is this actor the console or not
      Returns:
      Is this the console or not
    • getAsPlayer

      @Nullable @Nullable org.spongepowered.api.entity.living.player.Player getAsPlayer()
      Returns this actor as a Player if it is a player, otherwise returns null.
      Returns:
      The sender as a player, or null.
    • requirePlayer

      @NotNull @NotNull org.spongepowered.api.entity.living.player.Player requirePlayer() throws SenderNotPlayerException
      Returns this actor as a Player if it is a player, otherwise throws a SenderNotPlayerException.
      Returns:
      The actor as a player
      Throws:
      SenderNotPlayerException - if not a player
    • requireConsole

      @NotNull @NotNull org.spongepowered.api.command.source.ConsoleSource requireConsole() throws SenderNotConsoleException
      Returns this actor as a ConsoleSource if it is a player, otherwise throws a SenderNotConsoleException.
      Returns:
      The actor as console
      Throws:
      SenderNotConsoleException - if not a player
    • wrap

      @NotNull static @NotNull SpongeCommandActor wrap(@NotNull @NotNull org.spongepowered.api.command.CommandSource source, @NotNull @NotNull CommandHandler handler)
      Creates a new SpongeCommandActor that wraps the given CommandSource.
      Parameters:
      source - Command source to wrap
      Returns:
      The wrapping SpongeCommandActor.