Class CommandUtil
java.lang.Object
com.sk89q.worldedit.internal.command.CommandUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator<org.enginehub.piston.Command> static voidcheckCommandArgument(boolean condition, com.sk89q.worldedit.util.formatting.text.Component message) Requireconditionto betrue, otherwise throw aCommandExceptionwith the given message.static voidcheckCommandArgument(boolean condition, String message) Requireconditionto betrue, otherwise throw aCommandExceptionwith the given message.static com.sk89q.worldedit.util.formatting.text.ComponentcreateNewCommandReplacementText(String suggestedCommand) static org.enginehub.piston.Commanddeprecate(org.enginehub.piston.Command command, String reason, CommandUtil.ReplacementMessageGenerator replacementMessageGenerator) static Optional<com.sk89q.worldedit.util.formatting.text.Component> deprecationWarning(org.enginehub.piston.Command command) fixSuggestions(String arguments, List<Substring> suggestions) Fixsuggestionsto replace the last space-separated word inarguments.static Optional<com.sk89q.worldedit.util.formatting.text.Component> footerWithoutDeprecation(org.enginehub.piston.Command command) getSubCommands(org.enginehub.piston.Command currentCommand) static booleanisDeprecated(org.enginehub.piston.Command command) static <T> TrequireIV(org.enginehub.piston.inject.Key<T> type, String name, org.enginehub.piston.inject.InjectedValueAccess injectedValueAccess)
-
Method Details
-
createNewCommandReplacementText
public static com.sk89q.worldedit.util.formatting.text.Component createNewCommandReplacementText(String suggestedCommand) -
deprecate
public static org.enginehub.piston.Command deprecate(org.enginehub.piston.Command command, String reason, CommandUtil.ReplacementMessageGenerator replacementMessageGenerator) -
deprecationWarning
public static Optional<com.sk89q.worldedit.util.formatting.text.Component> deprecationWarning(org.enginehub.piston.Command command) -
isDeprecated
public static boolean isDeprecated(org.enginehub.piston.Command command) -
getSubCommands
-
byCleanName
-
fixSuggestions
Fixsuggestionsto replace the last space-separated word inarguments. -
checkCommandArgument
Requireconditionto betrue, otherwise throw aCommandExceptionwith the given message.- Parameters:
condition- the condition to checkmessage- the message for failure
-
checkCommandArgument
public static void checkCommandArgument(boolean condition, com.sk89q.worldedit.util.formatting.text.Component message) Requireconditionto betrue, otherwise throw aCommandExceptionwith the given message.- Parameters:
condition- the condition to checkmessage- the message for failure
-
requireIV
public static <T> T requireIV(org.enginehub.piston.inject.Key<T> type, String name, org.enginehub.piston.inject.InjectedValueAccess injectedValueAccess)
-