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 output, int pos, char ch)
    • iterate

      public static boolean iterate(String string, Style style, FormattedCharSink output)
    • iterateBackwards

      public static boolean iterateBackwards(String string, Style style, FormattedCharSink output)
    • iterateFormatted

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

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

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

      public static boolean iterateFormatted(FormattedText component, Style rootStyle, FormattedCharSink output)
    • filterBrokenSurrogates

      public static String filterBrokenSurrogates(String input)
    • getPlainText

      public static String getPlainText(FormattedText input)