Class TextHandler.WidthLimitingVisitor

java.lang.Object
net.minecraft.client.font.TextHandler.WidthLimitingVisitor
All Implemented Interfaces:
CharacterVisitor
Enclosing class:
TextHandler

@Environment(CLIENT)
class TextHandler.WidthLimitingVisitor
extends Object
implements CharacterVisitor
  • Field Details

    • widthLeft

      private float widthLeft
    • length

      private int length
  • Constructor Details

    • WidthLimitingVisitor

      public WidthLimitingVisitor​(float maxWidth)
  • Method Details

    • accept

      public boolean accept​(int index, Style style, int codePoint)
      Visits a single character.

      Multiple surrogate characters are converted into one single codePoint when passed into this method.

      Specified by:
      accept in interface CharacterVisitor
      Parameters:
      index - the current index of the character
      style - the style of the character, containing formatting and font information
      codePoint - the code point of the character
      Returns:
      true to continue visiting other characters, or false to terminate the visit
    • getLength

      public int getLength()
    • resetLength

      public void resetLength()