public class CommandUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Comparator<org.enginehub.piston.Command> |
byCleanName() |
static void |
checkCommandArgument(boolean condition,
com.sk89q.worldedit.util.formatting.text.Component message)
Require
condition to be true , otherwise throw a CommandException
with the given message. |
static void |
checkCommandArgument(boolean condition,
java.lang.String message)
Require
condition to be true , otherwise throw a CommandException
with the given message. |
static java.util.List<java.lang.String> |
fixSuggestions(java.lang.String arguments,
java.util.List<Substring> suggestions)
Fix
suggestions to replace the last space-separated word in arguments . |
static java.util.Map<java.lang.String,org.enginehub.piston.Command> |
getSubCommands(org.enginehub.piston.Command currentCommand) |
static <T> T |
requireIV(org.enginehub.piston.inject.Key<T> type,
java.lang.String name,
org.enginehub.piston.inject.InjectedValueAccess injectedValueAccess) |
public static java.util.Map<java.lang.String,org.enginehub.piston.Command> getSubCommands(org.enginehub.piston.Command currentCommand)
public static java.util.Comparator<org.enginehub.piston.Command> byCleanName()
public static java.util.List<java.lang.String> fixSuggestions(java.lang.String arguments, java.util.List<Substring> suggestions)
suggestions
to replace the last space-separated word in arguments
.public static void checkCommandArgument(boolean condition, java.lang.String message)
condition
to be true
, otherwise throw a CommandException
with the given message.condition
- the condition to checkmessage
- the message for failurepublic static void checkCommandArgument(boolean condition, com.sk89q.worldedit.util.formatting.text.Component message)
condition
to be true
, otherwise throw a CommandException
with the given message.condition
- the condition to checkmessage
- the message for failurepublic static <T> T requireIV(org.enginehub.piston.inject.Key<T> type, java.lang.String name, org.enginehub.piston.inject.InjectedValueAccess injectedValueAccess)