public class CommandUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CommandUtil.NewCommandGenerator |
static interface |
CommandUtil.ReplacementMessageGenerator |
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 com.sk89q.worldedit.util.formatting.text.Component |
createNewCommandReplacementText(java.lang.String suggestedCommand) |
static org.enginehub.piston.Command |
deprecate(org.enginehub.piston.Command command,
java.lang.String reason,
CommandUtil.ReplacementMessageGenerator replacementMessageGenerator) |
static java.util.Optional<com.sk89q.worldedit.util.formatting.text.Component> |
deprecationWarning(org.enginehub.piston.Command command) |
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.Optional<com.sk89q.worldedit.util.formatting.text.Component> |
footerWithoutDeprecation(org.enginehub.piston.Command command) |
static java.util.Map<java.lang.String,org.enginehub.piston.Command> |
getSubCommands(org.enginehub.piston.Command currentCommand) |
static boolean |
isDeprecated(org.enginehub.piston.Command command) |
static <T> T |
requireIV(org.enginehub.piston.inject.Key<T> type,
java.lang.String name,
org.enginehub.piston.inject.InjectedValueAccess injectedValueAccess) |
public static com.sk89q.worldedit.util.formatting.text.Component createNewCommandReplacementText(java.lang.String suggestedCommand)
public static org.enginehub.piston.Command deprecate(org.enginehub.piston.Command command, java.lang.String reason, CommandUtil.ReplacementMessageGenerator replacementMessageGenerator)
public static java.util.Optional<com.sk89q.worldedit.util.formatting.text.Component> footerWithoutDeprecation(org.enginehub.piston.Command command)
public static java.util.Optional<com.sk89q.worldedit.util.formatting.text.Component> deprecationWarning(org.enginehub.piston.Command command)
public static boolean isDeprecated(org.enginehub.piston.Command command)
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)