java.lang.Object
com.github.cyberryan1.cybercore.spigot.command.settings.CommandSettings
Direct Known Subclasses:
BaseCommand

public class CommandSettings extends Object
Contains all the settings for a command. Contains constructors, getters, setters, and checkers (but no chess (please laugh)) for the settings.
  • Constructor Details

    • CommandSettings

      public CommandSettings(String name, String permission, String permissionMsg, String usage)
    • CommandSettings

      public CommandSettings(String name, String permission, String usage)
    • CommandSettings

      public CommandSettings(String name, String usage)
  • Method Details

    • permissionsAllowed

      public boolean permissionsAllowed(org.bukkit.command.CommandSender sender)
      Whether the sender has permissions or not for the command
      Parameters:
      sender - the sender of the command
      Returns:
      true if the sender has permissions or if the permission variable is null, false otherwise
    • permsAllowed

      public boolean permsAllowed(org.bukkit.command.CommandSender sender)
      Whether the sender has permissions or not for the command
      Parameters:
      sender - the sender of the command
      Returns:
      true if the sender has permissions or if the permission variable is null, false otherwise
    • getName

      public final String getName()
      Returns:
      The name of the command
    • getPermission

      public final String getPermission()
      Returns:
      The permission of the command
    • getPermissionMsg

      public final String getPermissionMsg()
      Returns:
      The permission message for the command. If not set, CyberCommandUtils.getDefaultPermissionMsg() is returned instead.
    • getUsage

      public final String getUsage()
      Returns:
      The usage for the command
    • getInvalidPlayerMsg

      public final String getInvalidPlayerMsg()
      Returns:
      The invalid player message for the command. If not set, CyberCommandUtils.getInvalidPlayerMsg() is returned instead. Note that %s is where the attempted name should be inserted.
    • getInvalidIntegerMsg

      public final String getInvalidIntegerMsg()
      Returns:
      The invalid integer message for the command. If not set, CyberCommandUtils.getInvalidIntegerMsg() is returned instead. Note that %s is where the invalid integer should be inserted.
    • getInvalidDoubleMsg

      public final String getInvalidDoubleMsg()
      Returns:
      The invalid double message for the command. If not set, CyberCommandUtils.getInvalidDoubleMsg() is returned instead. Note that %s is where the invalid double should be inserted.
    • isDemandPlayer

      public final boolean isDemandPlayer()
      Returns:
      True if the command is only executable by players, false otherwise
    • isDemandConsole

      public final boolean isDemandConsole()
      Returns:
      True if the command is only executable by the console, false otherwise
    • isDemandPermission

      public final boolean isDemandPermission()
      Returns:
      True if the command is only executable by players with the permission, false otherwise
    • runAsync

      public final boolean runAsync()
      Returns:
      True if the command is asynchronous, false otherwise
    • isTabCompleteEnabled

      public final boolean isTabCompleteEnabled()
      Returns:
      True if the command has tab completion enabled, false otherwise
    • setInvalidPlayerMsg

      public final void setInvalidPlayerMsg(String msg)
      Sets the message that's sent to the player when they provide an invalid player. Use %s to mark where the invalid player name should be inserted.
      Parameters:
      msg - The message
    • setInvalidIntegerMsg

      public final void setInvalidIntegerMsg(String msg)
      Sets the message that's sent to the player when they provide an invalid integer. Use %s to mark where the invalid integer should be inserted.
      Parameters:
      msg - The message
    • setInvalidDoubleMsg

      public final void setInvalidDoubleMsg(String msg)
      Sets the message that's sent to the player when they provide an invalid double. Use %s to mark where the invalid double should be inserted.
      Parameters:
      msg - The message
    • setDemandPlayer

      public final void setDemandPlayer(boolean demandPlayer)
      Parameters:
      demandPlayer - Whether the command is only executable by players (true) or not (false)
    • demandPlayer

      public final void demandPlayer(boolean demandPlayer)
      Alias for the setDemandPlayer() method
      Parameters:
      demandPlayer - Whether the command is only executable by players (true) or not (false)
    • setDemandConsole

      public final void setDemandConsole(boolean demandConsole)
      Parameters:
      demandConsole - Whether the command is only executable by the console (true) or not (false)
    • demandConsole

      public final void demandConsole(boolean demandConsole)
      Alias for the setDemandConsole() method
      Parameters:
      demandConsole - Whether the command is only executable by the console (true) or not (false)
    • setDemandPermission

      public final void setDemandPermission(boolean demandPermission)
      Parameters:
      demandPermission - Whether the command is only executable by players with the permission (true) or not (false)
    • demandPermission

      public final void demandPermission(boolean demandPermission)
      Alias for the setDemandPermission() method
      Parameters:
      demandPermission - Whether the command is only executable by players with the permission (true) or not (false)
    • setRunAsync

      public final void setRunAsync(boolean async)
      Parameters:
      async - Whether the command is asynchronous (true) or not (false)
    • setTabCompleteEnabled

      public final void setTabCompleteEnabled(boolean tabCompleteEnabled)
      Parameters:
      tabCompleteEnabled - Whether the command has tab completion enabled (true) or not (false)