Class BungeeActor

java.lang.Object
revxrsal.commands.bungee.core.BungeeActor
All Implemented Interfaces:
BungeeCommandActor, CommandActor

public final class BungeeActor extends Object implements BungeeCommandActor
  • Constructor Details

    • BungeeActor

      public BungeeActor(net.md_5.bungee.api.CommandSender sender, CommandHandler handler)
  • Method Details

    • getSender

      public net.md_5.bungee.api.CommandSender getSender()
      Description copied from interface: BungeeCommandActor
      The underlying CommandSender for this subject
      Specified by:
      getSender in interface BungeeCommandActor
      Returns:
      The underlying sender
    • isPlayer

      public boolean isPlayer()
      Description copied from interface: BungeeCommandActor
      Returns whether is this sender a player or not
      Specified by:
      isPlayer in interface BungeeCommandActor
      Returns:
      Whether is that sender a player or not
    • asPlayer

      @Nullable public @Nullable net.md_5.bungee.api.connection.ProxiedPlayer asPlayer()
      Description copied from interface: BungeeCommandActor
      Returns this sender as a ProxiedPlayer.
      Specified by:
      asPlayer in interface BungeeCommandActor
      Returns:
      This sender as a player. Returns null if not a player.
    • requirePlayer

      @NotNull public @NotNull net.md_5.bungee.api.connection.ProxiedPlayer requirePlayer() throws SenderNotPlayerException
      Description copied from interface: BungeeCommandActor
      Requires this sender to be player, otherwise throws SenderNotPlayerException.
      Specified by:
      requirePlayer in interface BungeeCommandActor
      Returns:
      The sender as the player
      Throws:
      SenderNotPlayerException - if the sender is not a player (i.e console)
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: CommandActor
      Returns the name of this actor. Varies depending on the platform.
      Specified by:
      getName in interface CommandActor
      Returns:
      The actor name
    • getUniqueId

      @NotNull public @NotNull UUID getUniqueId()
      Description copied from interface: CommandActor
      Returns the unique UID of this subject. Varies depending on the platform.

      Although some platforms explicitly have their underlying senders have UUIDs, some platforms may have to generate this UUID based on other available data.

      Specified by:
      getUniqueId in interface CommandActor
      Returns:
      The UUID of this subject.
    • reply

      public void reply(@NotNull @NotNull String message)
      Description copied from interface: CommandActor
      Replies to the sender with the specified message.

      Varies depending on the platform.

      Specified by:
      reply in interface CommandActor
      Parameters:
      message - Message to reply with.
    • error

      public void error(@NotNull @NotNull String message)
      Description copied from interface: CommandActor
      Replies to the sender with the specified message, and marks it as an error depending on the platform.

      Note that, in certain platforms where no "error" mode is available, this may effectively be equivilent to calling CommandActor.reply(String).

      This method should not throw any exceptions.

      Specified by:
      error in interface CommandActor
      Parameters:
      message - Message to reply with
    • getCommandHandler

      public CommandHandler getCommandHandler()
      Description copied from interface: CommandActor
      Returns the command handler that constructed this actor
      Specified by:
      getCommandHandler in interface CommandActor
      Returns:
      The command handler
    • getLocale

      @NotNull public @NotNull Locale getLocale()
      Description copied from interface: CommandActor
      Returns the locale of this command actor. This can be used by translation tools to provide specialized messages.

      Note that platforms that do not support per-actor locales will return a default locale, mostly Locale.ENGLISH.

      Specified by:
      getLocale in interface CommandActor
      Returns:
      The actor's locale