Class CommandUtil
java.lang.Object
com.sk89q.worldedit.internal.command.CommandUtil
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator
<org.enginehub.piston.Command> static void
checkCommandArgument
(boolean condition, com.sk89q.worldedit.util.formatting.text.Component message) Requirecondition
to betrue
, otherwise throw aCommandException
with the given message.static void
checkCommandArgument
(boolean condition, String message) Requirecondition
to betrue
, otherwise throw aCommandException
with the given message.static com.sk89q.worldedit.util.formatting.text.Component
createNewCommandReplacementText
(String suggestedCommand) static org.enginehub.piston.Command
deprecate
(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) Fixsuggestions
to 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 boolean
isDeprecated
(org.enginehub.piston.Command command) static <T> T
requireIV
(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
Fixsuggestions
to replace the last space-separated word inarguments
. -
checkCommandArgument
Requirecondition
to betrue
, otherwise throw aCommandException
with 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) Requirecondition
to betrue
, otherwise throw aCommandException
with 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)
-