Package preponderous.ponder.system.abs
Class ApplicationCommand
java.lang.Object
preponderous.ponder.system.abs.ApplicationCommand
- Since:
- January 5th, 2022
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
execute(CommandSender sender)
Method to execute the command with no arguments.abstract boolean
execute(CommandSender sender, String[] args)
Method to execute the command with arguments.extractArgumentsInsideDoubleQuotes(String[] args)
int
getIntSafe(String line, int orElse)
Method to get an Integer from a String.getNames()
boolean
safeEquals(boolean matchCase, String what, String... goals)
Method to test if something matches any goal string.boolean
sendMessageIfNoArguments(String message, String[] args, CommandSender sender)
Method to send a message to a command sender if there are arguments.
-
Constructor Details
-
ApplicationCommand
-
-
Method Details
-
execute
Method to execute the command with no arguments.- Parameters:
sender
- The sender of the command.- Returns:
- Whether the execution of the command was successful.
-
execute
Method to execute the command with arguments.- Parameters:
sender
- The sender of the command.args
- The arguments of the command.- Returns:
- Whether the execution of the command was successful.
-
sendMessageIfNoArguments
Method to send a message to a command sender if there are arguments.- Parameters:
message
- The message to send.args
- The arguments to check.sender
- The sender of the command that we will be sending the message to.- Returns:
- Boolean signifying whether there were no arguments.
- Since:
- 10/12/2021
-
getIntSafe
Method to get an Integer from a String.- Parameters:
line
- to convert into an Integer.orElse
- if the conversion fails.- Returns:
Integer
numeric.- Since:
- 05/05/2021 - 12:18
-
safeEquals
Method to test if something matches any goal string.- Parameters:
what
- to testgoals
- to compare withmatchCase
- for the comparison (or not)- Returns:
true
if something in goals matches what.- Since:
- 05/05/2021 - 12:18
-
getNames
-
getPermissions
-
extractArgumentsInsideDoubleQuotes
- Throws:
Exception
-