Class TextHandler.LineBreakingVisitor

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

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

    • maxWidth

      private final float maxWidth
    • endIndex

      private int endIndex
    • endStyle

      private Style endStyle
    • nonEmpty

      private boolean nonEmpty
    • totalWidth

      private float totalWidth
    • lastSpaceBreak

      private int lastSpaceBreak
    • lastSpaceStyle

      private Style lastSpaceStyle
    • count

      private int count
    • startOffset

      private int startOffset
  • Constructor Details

    • LineBreakingVisitor

      public LineBreakingVisitor​(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
    • breakLine

      private boolean breakLine​(int finishIndex, Style finishStyle)
    • hasLineBreak

      private boolean hasLineBreak()
    • getEndingIndex

      public int getEndingIndex()
    • getEndingStyle

      public Style getEndingStyle()
    • offset

      public void offset​(int extraOffset)