Class StringDecomposer

java.lang.Object
net.minecraft.util.StringDecomposer

public class StringDecomposer extends Object
  • Field Details

  • Constructor Details

    • StringDecomposer

      public StringDecomposer()
  • Method Details

    • feedChar

      private static boolean feedChar(Style style, FormattedCharSink sink, int position, char character)
    • iterate

      public static boolean iterate(String text, Style style, FormattedCharSink sink)
    • iterateBackwards

      public static boolean iterateBackwards(String text, Style style, FormattedCharSink sink)
    • iterateFormatted

      public static boolean iterateFormatted(String text, Style style, FormattedCharSink sink)
      Iterate a String while applying legacy formatting codes starting with a § sign.
    • iterateFormatted

      public static boolean iterateFormatted(String text, int skip, Style style, FormattedCharSink sink)
      Iterate a String while applying legacy formatting codes starting with a § sign.
      Parameters:
      skip - The amount of characters to skip from the beginning.
    • iterateFormatted

      public static boolean iterateFormatted(String text, int skip, Style currentStyle, Style defaultStyle, FormattedCharSink sink)
      Iterate a String while applying legacy formatting codes starting with a § sign.
      Parameters:
      skip - The amount of character to skip from the beginning.
      currentStyle - The current style at the starting position after the skip.
      defaultStyle - The default style for the sequence that should be applied after a reset format code (§r)
    • iterateFormatted

      public static boolean iterateFormatted(FormattedText text, Style style, FormattedCharSink sink)
    • filterBrokenSurrogates

      public static String filterBrokenSurrogates(String text)
    • getPlainText

      public static String getPlainText(FormattedText text)