Class AbstractPluginCommand
java.lang.Object
preponderous.ponder.minecraft.bukkit.abs.AbstractPluginCommand
-
Constructor Summary
ConstructorDescriptionAbstractPluginCommand(ArrayList<String> names, ArrayList<String> permissions)
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
execute(org.bukkit.command.CommandSender sender)
Method to execute the command with no arguments.abstract boolean
extractArgumentsInsideDoubleQuotes(String[] args)
int
getIntSafe(String line, int orElse)
getNames()
boolean
safeEquals(boolean matchCase, String what, String... goals)
Method to test if something matches any goal string.boolean
sendMessageIfNoArguments(String message, String[] args, org.bukkit.command.CommandSender sender, org.bukkit.ChatColor color)
-
Constructor Details
-
AbstractPluginCommand
-
-
Method Details
-
execute
public abstract boolean execute(org.bukkit.command.CommandSender sender)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
- Parameters:
sender
- The sender of the command.args
- The arguments of the command.- Returns:
- Whether the execution of the command was successful.
-
sendMessageIfNoArguments
public boolean sendMessageIfNoArguments(String message, String[] args, org.bukkit.command.CommandSender sender, org.bukkit.ChatColor color)- Parameters:
message
- to send.args
- to check.sender
- to send message to.color
- of the message.- Returns:
- Boolean signifying whether there were no arguments.
- Since:
- 10/12/2021
-
getIntSafe
- 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
- Returns:
- A list of names of the command.
-
getPermissions
- Returns:
- A list of permissions of the command.
-
extractArgumentsInsideDoubleQuotes
- Throws:
Exception
-