Class BaseCommandSender

java.lang.Object
me.github.simonplays15.betterbansystem.core.player.BaseCommandSender
Direct Known Subclasses:
BungeeCordCommandSender, SpigotCommandSender

public abstract class BaseCommandSender extends Object
The BaseCommandSender class is an abstract class that represents a command sender. It provides methods for sending messages, checking permissions, getting the name of the sender, and determining the type of sender.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The BaseCommandSender class is an abstract class that represents a command sender.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    Retrieves the name of the command sender.
    Retrieves the type of the command sender.
    abstract boolean
    hasPermission (String permission)
    Checks if the command sender has the specified permission.
    boolean
    Checks if the command sender is a block.
    boolean
    Checks if the command sender is a console.
    boolean
    Checks if the sender type is OTHER.
    boolean
    Determines whether the command sender is a player.
    abstract void
    sendMessage (String string)
    Sends a message to the command sender.
    abstract void
    sendMessage (String... strings)
    Sends a message or multiple messages to the command sender.
    abstract void
    sendMessage (UUID uuid, String string)
    Sends a message to the player with the given UUID.
    abstract void
    sendMessage (UUID uuid, String... strings)
    Sends a message to the specified UUID recipient with the provided string messages.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseCommandSender

      public BaseCommandSender()
      The BaseCommandSender class is an abstract class that represents a command sender. It provides methods for sending messages, checking permissions, getting the name of the sender, and determining the type of sender.
  • Method Details

    • sendMessage

      public abstract void sendMessage (String string)
      Sends a message to the command sender.
      Parameters:
      string - the message to be sent
    • sendMessage

      public abstract void sendMessage (String... strings)
      Sends a message or multiple messages to the command sender.
      Parameters:
      strings - the messages to be sent to the command sender
    • sendMessage

      public abstract void sendMessage (UUID uuid, String string)
      Sends a message to the player with the given UUID. If the UUID is null, the message is sent to the console.
      Parameters:
      uuid - The UUID of the player to send the message to. Can be null for console.
      string - The message to send.
    • sendMessage

      public abstract void sendMessage (UUID uuid, String... strings)
      Sends a message to the specified UUID recipient with the provided string messages.
      Parameters:
      uuid - the UUID of the recipient
      strings - the string message(s) to send
    • hasPermission

      public abstract boolean hasPermission (String permission)
      Checks if the command sender has the specified permission.
      Parameters:
      permission - the permission to check
      Returns:
      true if the command sender has the permission, false otherwise
    • getName

      public abstract String getName()
      Retrieves the name of the command sender.
      Returns:
      the name of the command sender
    • getSenderType

      public abstract CommandSenderType getSenderType()
      Retrieves the type of the command sender.
      Returns:
      The CommandSenderType representing the type of the command sender.
    • isConsole

      public boolean isConsole()
      Checks if the command sender is a console.
      Returns:
      true if the command sender is a console, false otherwise.
    • isPlayer

      public boolean isPlayer()
      Determines whether the command sender is a player.
      Returns:
      true if the command sender is a player, otherwise false.
    • isOther

      public boolean isOther()
      Checks if the sender type is OTHER.
      Returns:
      true if the sender type is OTHER, false otherwise.
    • isBlock

      public boolean isBlock()
      Checks if the command sender is a block.
      Returns:
      true if the command sender is a block, false otherwise.