java.lang.Object
meteordevelopment.meteorclient.utils.misc.text.TextUtils

public class TextUtils extends Object
Some utilities for Text
  • Method Details

    • toColoredTextList

      public static List<ColoredText> toColoredTextList(net.minecraft.text.Text text)
    • parseOrderedText

      public static net.minecraft.text.MutableText parseOrderedText(net.minecraft.text.OrderedText orderedText)
      Parses a given OrderedText into its Text equivalent.
      Parameters:
      orderedText - the OrderedText to parse.
      Returns:
      The Text equivalent of the OrderedText parameter.
    • getMostPopularColor

      public static Color getMostPopularColor(net.minecraft.text.Text text)
      Returns the Color that is most prevalent through the given Text
      Parameters:
      text - the Text to scan through
      Returns:
      You know what it returns. Read the docs! Also, returns white if the internal Object2IntMap.Entry is null
    • getColoredCharacterCount

      public static it.unimi.dsi.fastutil.objects.Object2IntMap<Color> getColoredCharacterCount(List<ColoredText> coloredTexts)
      Takes a List of ColoredText and returns a HashMap, where the keys are all the existing Colors in the aforementioned list, and the corresponding keys are the number of characters that have that color.
      Parameters:
      coloredTexts - The list of ColoredText to obtain the color count of. Best paired with the output from toColoredTextList(Text)
      Returns:
      a Map whose keys are colors (and the set of keys being all possible colors used in the list, thus all colors in the text, if the argument for this function is fed from the return from toColoredTextList(Text)), and the corresponding values being Integers representing the number of occurrences of text that bear that color. The order of the keys are in no particular order