public class BedrockTextUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BedrockTextUtils.LegacyStyle |
| Constructor and Description |
|---|
BedrockTextUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BedrockTextUtils.LegacyStyle |
getStyleAt(java.lang.String s,
int position)
Get the legacy style of a string at the given position.
|
static BedrockTextUtils.LegacyStyle |
getStyleAt(java.lang.String s,
int position,
java.util.function.Function<java.lang.Character,BedrockTextFormatting> formattingResolver)
Get the legacy style of a string at the given position.
|
static java.lang.String[] |
split(java.lang.String s,
java.lang.String split)
Split a string by a given split string and keep the legacy style of the previous part.
|
static java.lang.String[] |
split(java.lang.String s,
java.lang.String split,
java.util.function.Function<java.lang.Character,BedrockTextFormatting> formattingResolver)
Split a string by a given split string and keep the legacy style of the previous part.
|
public static BedrockTextUtils.LegacyStyle getStyleAt(java.lang.String s, int position)
s - The string to get the style fromposition - The position to get the style atpublic static BedrockTextUtils.LegacyStyle getStyleAt(java.lang.String s, int position, java.util.function.Function<java.lang.Character,BedrockTextFormatting> formattingResolver)
formattingResolver should return a formatting for the given char or null if the previous formatting should be kept.bold, italic, etc. will be reset.s - The string to get the style fromposition - The position to get the style atformattingResolver - The function that resolves the formatting for the given charpublic static java.lang.String[] split(java.lang.String s,
java.lang.String split)
s - The string to splitsplit - The split stringpublic static java.lang.String[] split(java.lang.String s,
java.lang.String split,
java.util.function.Function<java.lang.Character,BedrockTextFormatting> formattingResolver)
formattingResolver should return a formatting for the given char or null if the previous formatting should be kept.bold, italic, etc. will be reset.s - The string to splitsplit - The split stringformattingResolver - The function that resolves the formatting for the given char