Class BungeeCordCommandSender

java.lang.Object
me.github.simonplays15.betterbansystem.core.player.BaseCommandSender
me.github.simonplays15.betterbansystem.core.player.BungeeCordCommandSender
All Implemented Interfaces:
net.md_5.bungee.api.CommandSender

public class BungeeCordCommandSender extends BaseCommandSender implements net.md_5.bungee.api.CommandSender
The BungeeCordCommandSender class extends the BaseCommandSender class and represents a BungeeCord command sender. It provides methods for sending messages, checking permissions, and getting the name and type of the sender.
  • Constructor Details

    • BungeeCordCommandSender

      public BungeeCordCommandSender (net.md_5.bungee.api.CommandSender sender)
      The BungeeCordCommandSender class represents a command sender in the BungeeCord API. It extends the BaseCommandSender abstract class.
    • BungeeCordCommandSender

      public BungeeCordCommandSender (Object sender)
      BungeeCordCommandSender represents a command sender in the BungeeCord API. It extends the BaseCommandSender class and provides methods for sending messages, checking permissions , getting the name of the sender, and determining the type of sender.
  • Method Details

    • of

      @NotNull public static @NotNull BungeeCordCommandSender of (Object sender)
      Creates a BungeeCordCommandSender object from the given sender.
      Parameters:
      sender - the CommandSender object
      Returns:
      the BungeeCordCommandSender object
      Throws:
      IllegalArgumentException - if the sender type is not supported
    • sendMessages

      public void sendMessages (String @NotNull ... strings)
      Sends multiple messages to the command sender.
      Specified by:
      sendMessages in interface net.md_5.bungee.api.CommandSender
      Parameters:
      strings - the messages to be sent
      Throws:
      IllegalArgumentException - if any of the messages is null
    • sendMessage

      public void sendMessage (net.md_5.bungee.api.chat.BaseComponent... baseComponents)
      Overrides the sendMessage method of the BaseCommandSender class to send multiple messages using BaseComponent.
      Specified by:
      sendMessage in interface net.md_5.bungee.api.CommandSender
      Parameters:
      baseComponents - the BaseComponent messages to be sent
    • sendMessage

      public void sendMessage (net.md_5.bungee.api.chat.BaseComponent baseComponent)
      Sends a message to the command sender.
      Specified by:
      sendMessage in interface net.md_5.bungee.api.CommandSender
      Parameters:
      baseComponent - the BaseComponent to be sent as a message
      Since:
      version 1.0
    • getGroups

      public Collection<String> getGroups()
      Retrieves the groups associated with the command sender.
      Specified by:
      getGroups in interface net.md_5.bungee.api.CommandSender
      Returns:
      a Collection of strings representing the groups associated with the command sender
    • addGroups

      public void addGroups (String... strings)
      Adds the specified groups to the command sender.
      Specified by:
      addGroups in interface net.md_5.bungee.api.CommandSender
      Parameters:
      strings - the groups to be added
    • removeGroups

      public void removeGroups (String... strings)
      Removes the specified groups from the command sender.
      Specified by:
      removeGroups in interface net.md_5.bungee.api.CommandSender
      Parameters:
      strings - the groups to be removed
    • setPermission

      public void setPermission (String permission, boolean value)
      Sets a permission for the command sender.
      Specified by:
      setPermission in interface net.md_5.bungee.api.CommandSender
      Parameters:
      permission - the permission to be set
      value - true if the permission is granted, false if it is denied
    • getPermissions

      public Collection<String> getPermissions()
      Retrieves the permissions of the command sender.
      Specified by:
      getPermissions in interface net.md_5.bungee.api.CommandSender
      Returns:
      a Collection of strings representing the permissions of the command sender
    • sendMessage

      public void sendMessage (String string)
      Sends a message to the command sender.
      Specified by:
      sendMessage in interface net.md_5.bungee.api.CommandSender
      Specified by:
      sendMessage in class BaseCommandSender
      Parameters:
      string - the message to be sent
    • sendMessage

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

      public 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.
      Specified by:
      sendMessage in class BaseCommandSender
      Parameters:
      uuid - The UUID of the player to send the message to. Can be null for console.
      string - The message to send.
    • sendMessage

      public void sendMessage (UUID uuid, String... strings)
      Sends a message or multiple messages to the command sender.
      Specified by:
      sendMessage in class BaseCommandSender
      Parameters:
      uuid - the UUID of the recipient
      strings - the string message(s) to send
    • hasPermission

      public boolean hasPermission (String permission)
      Checks if the command sender has the specified permission.
      Specified by:
      hasPermission in interface net.md_5.bungee.api.CommandSender
      Specified by:
      hasPermission in class BaseCommandSender
      Parameters:
      permission - the permission to check
      Returns:
      true if the command sender has the permission, false otherwise
    • getName

      public String getName()
      Retrieves the name of the command sender.
      Specified by:
      getName in interface net.md_5.bungee.api.CommandSender
      Specified by:
      getName in class BaseCommandSender
      Returns:
      the name of the command sender
    • getSenderType

      public CommandSenderType getSenderType()
      Retrieves the type of the command sender.
      Specified by:
      getSenderType in class BaseCommandSender
      Returns:
      The CommandSenderType representing the type of the command sender.