Class CyberCommandUtils
java.lang.Object
com.github.cyberryan1.cybercore.spigot.utils.CyberCommandUtils
Command utilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
combineArgs
(String[] args) Combines the list into a string with each item separated by a spacestatic String
combineArgs
(String[] args, int start) Combines the list into a string with each item separated by a space, starting at the index providedstatic String
Gets the message that is sent, by default, when a player doesn't have permission to execute a commandstatic String
Gets the message that's sent, by default, when a double is invalidstatic String
Gets the message that's sent, by default, when an integer is invalidstatic String
Gets the message that's sent, by default, when a name provided is invalidReturns all strings from a list that starts with the inputReturns all strings from a list that starts with the inputmatchOnlinePlayers
(String input) static void
Sets the message that is sent, by default, when a player doesn't have permission to execute a commandstatic void
Sets the message that is sent, by default, when a double is invalidstatic void
Sets the message that is sent, by default, when an integer is invalidstatic void
Sets the message that is sent, by default, when a name provided is invalid
-
Constructor Details
-
CyberCommandUtils
public CyberCommandUtils()
-
-
Method Details
-
setDefaultPermissionMsg
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
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
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
Gets the message that's sent, by default, when a name provided is invalid- Returns:
- The unformatted message (%s = the provided name)
-
setInvalidIntegerMsg
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
Gets the message that's sent, by default, when an integer is invalid- Returns:
- The unformatted message (%s = the integer)
-
setInvalidDoubleMsg
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
Gets the message that's sent, by default, when a double is invalid- Returns:
- The unformatted message (%s = the double)
-
combineArgs
Combines the list into a string with each item separated by a space- Parameters:
args
- the list to combine- Returns:
- the combined string
-
combineArgs
Combines the list into a string with each item separated by a space, starting at the index provided- Parameters:
args
- the list to combinestart
- the index to start at- Returns:
- the combined string
-
getOnlinePlayerNames
- Returns:
- a list of all online player names
-
matchOnlinePlayers
- Parameters:
input
- the input to match- Returns:
- a list of all online player names that starts with the input
-
matchArgs
Returns all strings from a list that starts with the input- Parameters:
list
- the list to matchinput
- the input to match- Returns:
- a list of all strings from the list that starts with the input
-
matchArgs
Returns all strings from a list that starts with the input- Parameters:
list
- the list to matchinput
- the input to match- Returns:
- a list of all strings from the list that starts with the input
-