Class AdventureUtil

java.lang.Object
com.earth2me.essentials.utils.AdventureUtil

public final class AdventureUtil extends Object
  • Method Details

    • setEss

      public static void setEss(IEssentials ess)
    • miniMessage

      public static net.kyori.adventure.text.minimessage.MiniMessage miniMessage()
    • legacyToAdventure

      public static net.kyori.adventure.text.Component legacyToAdventure(String text)
      Converts a section sign legacy string to an adventure component.
    • adventureToLegacy

      public static String adventureToLegacy(net.kyori.adventure.text.Component component)
      Converts an adventure component to a section sign legacy string.
    • miniToLegacy

      public static String miniToLegacy(String format)
      Converts a MiniMessage string to a section sign legacy string.
    • legacyToMini

      public static String legacyToMini(String text)
      Converts a section sign legacy string to a MiniMessage string.
    • legacyToMini

      public static String legacyToMini(String text, boolean useCustomTags)
      Converts a section sign legacy string to a MiniMessage string.
      Parameters:
      useCustomTags - true if gold and red colors should use primary and secondary tags instead.
    • fromChar

      public static net.kyori.adventure.text.format.NamedTextColor fromChar(char c)
      Get the NamedTextColor from its associated section sign char.
    • escapeTags

      public static String escapeTags(String input)
      Convenience method for submodules to escape MiniMessage tags.
    • parsed

      public static AdventureUtil.ParsedPlaceholder parsed(String literal)
      Parameters for a translation message are not parsed for MiniMessage by default to avoid injection. If you want a parameter to be parsed for MiniMessage you must wrap it in a ParsedPlaceholder by using this method.