Package com.sk89q.worldguard.commands
Class CommandUtils
java.lang.Object
com.sk89q.worldguard.commands.CommandUtils
Command-related utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetOwnerName(Object owner)Get the name of the given owner object.static Function<com.sk89q.worldedit.util.formatting.text.TextComponent,?>messageComponentFunction(com.sk89q.worldedit.extension.platform.Actor sender)Return a function that accepts a TextComponent to send a message to the given sender.messageFunction(com.sk89q.worldedit.extension.platform.Actor sender)Return a function that accepts a string to send a message to the given sender.static StringreplaceColorMacros(String str)Replace color macros in a string.
-
Method Details
-
replaceColorMacros
Replace color macros in a string.- Parameters:
str- the string- Returns:
- the new string
-
getOwnerName
Get the name of the given owner object.- Parameters:
owner- the owner object- Returns:
- a name
-
messageFunction
public static Function<String,?> messageFunction(com.sk89q.worldedit.extension.platform.Actor sender)Return a function that accepts a string to send a message to the given sender.- Parameters:
sender- the sender- Returns:
- a function
-
messageComponentFunction
public static Function<com.sk89q.worldedit.util.formatting.text.TextComponent,?> messageComponentFunction(com.sk89q.worldedit.extension.platform.Actor sender)Return a function that accepts a TextComponent to send a message to the given sender.- Parameters:
sender- the sender- Returns:
- a function
-