Class TextUtils
java.lang.Object
meteordevelopment.meteorclient.utils.misc.text.TextUtils
Some utilities for
Text-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic it.unimi.dsi.fastutil.objects.Object2IntMap<Color>getColoredCharacterCount(List<ColoredText> coloredTexts) Takes aListofColoredTextand returns aHashMap, where the keys are all the existingColors in the aforementioned list, and the corresponding keys are the number of characters that have that color.static ColorgetMostPopularColor(net.minecraft.text.Text text) Returns theColorthat is most prevalent through the givenTextstatic net.minecraft.text.MutableTextparseOrderedText(net.minecraft.text.OrderedText orderedText) Parses a givenOrderedTextinto itsTextequivalent.static List<ColoredText>toColoredTextList(net.minecraft.text.Text text)
-
Constructor Details
-
TextUtils
public TextUtils()
-
-
Method Details
-
toColoredTextList
-
parseOrderedText
public static net.minecraft.text.MutableText parseOrderedText(net.minecraft.text.OrderedText orderedText) Parses a givenOrderedTextinto itsTextequivalent.- Parameters:
orderedText- theOrderedTextto parse.- Returns:
- The
Textequivalent of theOrderedTextparameter.
-
getMostPopularColor
Returns theColorthat is most prevalent through the givenText- Parameters:
text- theTextto scan through- Returns:
- You know what it returns. Read the docs! Also, returns white if the internal
Object2IntMap.Entryis null
-
getColoredCharacterCount
public static it.unimi.dsi.fastutil.objects.Object2IntMap<Color> getColoredCharacterCount(List<ColoredText> coloredTexts) Takes aListofColoredTextand returns aHashMap, where the keys are all the existingColors in the aforementioned list, and the corresponding keys are the number of characters that have that color.- Parameters:
coloredTexts- The list ofColoredTextto obtain the color count of. Best paired with the output fromtoColoredTextList(Text)- Returns:
- a
Mapwhose 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 fromtoColoredTextList(Text)), and the corresponding values beingIntegers representing the number of occurrences of text that bear that color. The order of the keys are in no particular order
-