Class CommandUtils

java.lang.Object
com.sk89q.worldguard.commands.CommandUtils

public final class CommandUtils extends Object
Command-related utility methods.
  • Method Details

    • replaceColorMacros

      public static String replaceColorMacros(String str)
      Replace color macros in a string.
      Parameters:
      str - the string
      Returns:
      the new string
    • getOwnerName

      public static String getOwnerName(@Nullable Object owner)
      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