Class CyberCommandUtils

java.lang.Object
com.github.cyberryan1.cybercore.spigot.utils.CyberCommandUtils

public class CyberCommandUtils extends Object
Command utilities
  • Constructor Details

    • CyberCommandUtils

      public CyberCommandUtils()
  • Method Details

    • setDefaultPermissionMsg

      public static void setDefaultPermissionMsg(String msg)
      Sets the message that is sent, by default, when a player doesn't have permission to execute a command
      Parameters:
      msg - the message to send
    • getDefaultPermissionMsg

      public static String getDefaultPermissionMsg()
      Gets the message that is sent, by default, when a player doesn't have permission to execute a command
      Returns:
      the message to send
    • setInvalidPlayerMsg

      public static void setInvalidPlayerMsg(String msg)
      Sets the message that is sent, by default, when a name provided is invalid
      Parameters:
      msg - the message to send (use %s for the player's name)
    • getInvalidPlayerMsg

      public static String getInvalidPlayerMsg()
      Gets the message that's sent, by default, when a name provided is invalid
      Returns:
      The unformatted message (%s = the provided name)
    • setInvalidIntegerMsg

      public static void setInvalidIntegerMsg(String msg)
      Sets the message that is sent, by default, when an integer is invalid
      Parameters:
      msg - the message to send (use %s for the integer)
    • getInvalidIntegerMsg

      public static String getInvalidIntegerMsg()
      Gets the message that's sent, by default, when an integer is invalid
      Returns:
      The unformatted message (%s = the integer)
    • setInvalidDoubleMsg

      public static void setInvalidDoubleMsg(String msg)
      Sets the message that is sent, by default, when a double is invalid
      Parameters:
      msg - the message to send (use %s for the double)
    • getInvalidDoubleMsg

      public static String getInvalidDoubleMsg()
      Gets the message that's sent, by default, when a double is invalid
      Returns:
      The unformatted message (%s = the double)
    • combineArgs

      public static String combineArgs(String[] args)
      Combines the list into a string with each item separated by a space
      Parameters:
      args - the list to combine
      Returns:
      the combined string
    • combineArgs

      public static String combineArgs(String[] args, int start)
      Combines the list into a string with each item separated by a space, starting at the index provided
      Parameters:
      args - the list to combine
      start - the index to start at
      Returns:
      the combined string
    • getOnlinePlayerNames

      public static List<String> getOnlinePlayerNames()
      Returns:
      a list of all online player names
    • matchOnlinePlayers

      public static List<String> matchOnlinePlayers(String input)
      Parameters:
      input - the input to match
      Returns:
      a list of all online player names that starts with the input
    • matchArgs

      public static List<String> matchArgs(ArrayList<String> list, String input)
      Returns all strings from a list that starts with the input
      Parameters:
      list - the list to match
      input - the input to match
      Returns:
      a list of all strings from the list that starts with the input
    • matchArgs

      public static List<String> matchArgs(List<String> list, String input)
      Returns all strings from a list that starts with the input
      Parameters:
      list - the list to match
      input - the input to match
      Returns:
      a list of all strings from the list that starts with the input