Interface CommandSender


public interface CommandSender
Represents an entity that can send commands.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(Component component)
    Sends an error message to the sender.
    void
    error(String text)
    Sends an error message to the sender.
    Returns the audience of this command sender.
    Returns the locale of this command sender.
    Returns the name of this command sender.
    Returns the permissions of this command sender.
    mindustry.gen.Player
    Returns the player of this command sender.
    boolean
    Returns whether this sender is a player.
    boolean
    Returns whether this sender is the server.
    player(mindustry.gen.Player player)
    Wraps a player into a command sender.
    void
    reply(Component component)
    Sends a message to the sender.
    void
    reply(String text)
    Sends a message to the sender.
    Returns the server itself as a command sender.
  • Method Details

    • player

      static CommandSender player(mindustry.gen.Player player)
      Wraps a player into a command sender.
      Parameters:
      player - the player to wrap
      Returns:
      the player command sender
    • server

      static CommandSender server()
      Returns the server itself as a command sender.
    • getName

      String getName()
      Returns the name of this command sender.
    • reply

      void reply(String text)
      Sends a message to the sender.
      Parameters:
      text - the message to send
    • reply

      void reply(Component component)
      Sends a message to the sender.
      Parameters:
      component - the message to send
    • error

      void error(String text)
      Sends an error message to the sender.
      Parameters:
      text - the message to send
    • error

      void error(Component component)
      Sends an error message to the sender.
      Parameters:
      component - the message to send
    • isPlayer

      boolean isPlayer()
      Returns whether this sender is a player.
    • isServer

      boolean isServer()
      Returns whether this sender is the server.
    • getPlayer

      mindustry.gen.Player getPlayer()
      Returns the player of this command sender.
      Returns:
      the player of this command sender
      Throws:
      UnsupportedOperationException - if this sender is not a player
    • getPermissions

      PermissionContainer getPermissions()
      Returns the permissions of this command sender.
    • getLocale

      Locale getLocale()
      Returns the locale of this command sender.
    • getAudience

      Audience getAudience()
      Returns the audience of this command sender.