public class FontOptions
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FontOptions.FontOptionsBuilder |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(net.minecraft.util.text.TextFormatting ecf)
Applies the
TextFormatting style to this FontOptions. |
static FontOptions.FontOptionsBuilder |
builder()
Create the
FontOptions.FontOptionsBuilder for a new FontOptions. |
static java.lang.String |
formattingAsText(java.util.List<net.minecraft.util.text.TextFormatting> list)
Gets the string corresponding to the passed
TextFormattings. |
int |
getColor()
Gets the color for this
FontOptions. |
float |
getFontScale()
Gets the font scale for this
FontOptions. |
static net.minecraft.util.text.TextFormatting |
getFormatting(java.lang.String text,
int index)
Gets the
TextFormatting at the specified position in the text. |
static java.util.List<net.minecraft.util.text.TextFormatting> |
getFormattings(java.lang.String text,
int index)
Gets the
TextFormattings at the specified position in the text. |
static Link |
getLink(java.lang.String text,
int index) |
int |
getShadowColor()
Gets the shadow color corresponding to the current color.
|
static org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.String> |
getStartFormat(java.lang.String text)
Gets a
Pair separating the TextFormatting tags at the beginning of a text. |
boolean |
hasShadow()
Checks whether draw shadow is enabled for this
FontOptions. |
boolean |
isBold()
Checks if this
FontOptions is bold. |
static boolean |
isFormatting(java.lang.String text,
int index)
Checks if there is a
TextFormatting at the specified position in the text. |
boolean |
isFormattingDisabled()
Checks if formatting is disabled (formatting character are renderer literally).
|
boolean |
isItalic()
Checks if this
FontOptions is italic. |
boolean |
isStrikethrough()
Checks if this
FontOptions is strikethrough. |
boolean |
isUnderline()
Checks if this
FontOptions is underlined. |
FontOptions |
notTranslated()
Get a non translation version of this
FontOptions |
int |
processStyles(java.lang.String text)
Process styles applied to the beginning of the text with
TextFormatting values. |
int |
processStyles(java.lang.String text,
int index)
Process styles applied at the specified position in the text with
TextFormatting values. |
void |
resetLineOptions() |
void |
resetStyles()
Resets styles to the default values.
|
void |
saveDefault()
Saves the current styles as default.
|
void |
setLineOptions(FontOptions options)
Sets the line options.
|
boolean |
shouldTranslate()
Checks if the text should be translated before rendering.
|
public float getFontScale()
FontOptions.public boolean isBold()
FontOptions is bold.public boolean isItalic()
FontOptions is italic.public boolean isUnderline()
FontOptions is underlined.public boolean isStrikethrough()
FontOptions is strikethrough.public boolean hasShadow()
FontOptions.public int getColor()
FontOptions.public boolean isFormattingDisabled()
public boolean shouldTranslate()
public int processStyles(java.lang.String text)
TextFormatting values.FontOptions and returns the number of characters read.text - the textpublic int processStyles(java.lang.String text,
int index)
TextFormatting values.FontOptions and returns the number of characters read.text - the textindex - the indexpublic void apply(net.minecraft.util.text.TextFormatting ecf)
TextFormatting style to this FontOptions.ecf - the ecfpublic void saveDefault()
resetStyles() is called.public void resetStyles()
public void setLineOptions(FontOptions options)
options - the new line optionspublic void resetLineOptions()
public int getShadowColor()
public static net.minecraft.util.text.TextFormatting getFormatting(java.lang.String text,
int index)
TextFormatting at the specified position in the text.text - the textindex - the indexpublic static java.util.List<net.minecraft.util.text.TextFormatting> getFormattings(java.lang.String text,
int index)
TextFormattings at the specified position in the text.text - the textindex - the indexpublic static java.lang.String formattingAsText(java.util.List<net.minecraft.util.text.TextFormatting> list)
TextFormattings.list - the listpublic static boolean isFormatting(java.lang.String text,
int index)
TextFormatting at the specified position in the text.text - the textindex - the indexpublic static org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.String> getStartFormat(java.lang.String text)
Pair separating the TextFormatting tags at the beginning of a text.text - the textpublic static Link getLink(java.lang.String text, int index)
public FontOptions notTranslated()
FontOptionspublic static FontOptions.FontOptionsBuilder builder()
FontOptions.FontOptionsBuilder for a new FontOptions.