Package net.minecraft.client.font
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 Summary
-
Constructor Summary
Constructors Constructor Description WidthLimitingVisitor(float maxWidth) -
Method Summary
Modifier and Type Method Description booleanaccept(int index, Style style, int codePoint)Visits a single character.intgetLength()voidresetLength()
-
Field Details
-
widthLeft
private float widthLeft -
length
private int length
-
-
Constructor Details
-
WidthLimitingVisitor
public WidthLimitingVisitor(float maxWidth)
-
-
Method Details
-
accept
Visits a single character.Multiple surrogate characters are converted into one single
codePointwhen passed into this method.- Specified by:
acceptin interfaceCharacterVisitor- Parameters:
index- the current index of the characterstyle- the style of the character, containing formatting and font informationcodePoint- the code point of the character- Returns:
trueto continue visiting other characters, orfalseto terminate the visit
-
getLength
public int getLength() -
resetLength
public void resetLength()
-