Class AbstractSender<T>

java.lang.Object
me.lucko.luckperms.common.sender.AbstractSender<T>
Type Parameters:
T - the command sender type
All Implemented Interfaces:
Sender

public final class AbstractSender<T> extends Object implements Sender
Simple implementation of Sender using a SenderFactory
  • Method Details

    • getPlugin

      public LuckPermsPlugin getPlugin()
      Description copied from interface: Sender
      Gets the plugin instance the sender is from.
      Specified by:
      getPlugin in interface Sender
      Returns:
      the plugin
    • getUniqueId

      public UUID getUniqueId()
      Description copied from interface: Sender
      Gets the sender's unique id.

      See Sender.CONSOLE_UUID for the console's UUID representation.

      Specified by:
      getUniqueId in interface Sender
      Returns:
      the sender's uuid
    • getName

      public String getName()
      Description copied from interface: Sender
      Gets the sender's username
      Specified by:
      getName in interface Sender
      Returns:
      a friendly username for the sender
    • sendMessage

      public void sendMessage(net.kyori.adventure.text.Component message)
      Description copied from interface: Sender
      Send a json message to the Sender.
      Specified by:
      sendMessage in interface Sender
      Parameters:
      message - the message to send.
    • getPermissionValue

      public net.luckperms.api.util.Tristate getPermissionValue(String permission)
      Description copied from interface: Sender
      Gets the tristate a permission is set to.
      Specified by:
      getPermissionValue in interface Sender
      Parameters:
      permission - the permission to check for
      Returns:
      a tristate
    • hasPermission

      public boolean hasPermission(String permission)
      Description copied from interface: Sender
      Check if the Sender has a permission.
      Specified by:
      hasPermission in interface Sender
      Parameters:
      permission - the permission to check for
      Returns:
      true if the sender has the permission
    • performCommand

      public void performCommand(String commandLine)
      Description copied from interface: Sender
      Makes the sender perform a command.
      Specified by:
      performCommand in interface Sender
      Parameters:
      commandLine - the command
    • isConsole

      public boolean isConsole()
      Description copied from interface: Sender
      Gets whether this sender is the console
      Specified by:
      isConsole in interface Sender
      Returns:
      if the sender is the console
    • isValid

      public boolean isValid()
      Description copied from interface: Sender
      Gets whether this sender is still valid invalid input: '&' receiving messages.
      Specified by:
      isValid in interface Sender
      Returns:
      if this sender is valid
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • splitNewlines

      public static Iterable<net.kyori.adventure.text.Component> splitNewlines(net.kyori.adventure.text.Component message)