Class TextUtil
java.lang.Object
my.celium.org.util.TextUtil
Small helpers around
Component. Mycel does not rebuild the text
system - these just remove qualifier noise.
The palette below is the shared Mycel look and uses only colors from the
MyCelium wiki's dark theme (chat is always drawn on a dark backdrop): the
page tokens (--accent, --text, --muted) plus the
dark code-highlight tokens (.tok-*). No legacy § colors.
Legacy helpers (green(String), red(String),
gray(String), gold(String)) keep their signatures and
render through the matching tone.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWiki blue (.tok-k) - mod names, config keys.static final intWiki--text- body text.static final intWhite - names and titles that should stand out from body text.static final intWiki red (--accent) - errors.static final intWiki comment grey (.tok-c) - brackets, bullets, dividers.static final intWiki purple (.tok-n) - values, commands.static final intWiki--muted- secondary text.static final intWiki red (--accent) - brand, headers.static final intWiki green (.tok-s) - success.static final intWiki orange (.tok-a) - warnings / gold. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentWarning line: orange bang + message.static net.minecraft.network.chat.MutableComponentcolored(net.minecraft.network.chat.Component text, net.minecraft.ChatFormatting formatting) Deprecated.static net.minecraft.network.chat.MutableComponentcoloredHex(net.minecraft.network.chat.Component text, int rgb) Applies a raw RGB color (0xRRGGBB) to a copy oftext.static net.minecraft.network.chat.MutableComponentIndented continuation line (descriptions, hints) under anitem(Component).static net.minecraft.network.chat.MutableComponentdivider()Faint divider used between sections.static net.minecraft.network.chat.MutableComponentempty()static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentError line: red cross + message.static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentHeader line opening a multi-line reply: tag + bright title.static net.minecraft.network.chat.MutableComponentHeader line with a muted suffix, e.g.static net.minecraft.network.chat.MutableComponentHex-colored literal from a raw RGB int (0xRRGGBB).static net.minecraft.network.chat.MutableComponentHex-colored literal, e.g.static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentitem(net.minecraft.network.chat.Component content) Indented row under aheader(String): faint bullet + content, no tag.static net.minecraft.network.chat.MutableComponentjoin(String separator, Collection<? extends net.minecraft.network.chat.Component> parts) Joins components with a literal separator.static net.minecraft.network.chat.MutableComponentkey: value pair with accent key and bright value.static net.minecraft.network.chat.MutableComponentkey: value pair with a pre-built value component.static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentA message from parts: strings become body text, components are appended as they are.static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentInfo line: plain message after the tag.static net.minecraft.network.chat.MutableComponentSuccess line: green check + message.static intParses"#RRGGBB"or"RRGGBB"into0xRRGGBB.static Stringplain(net.minecraft.network.chat.Component component) Plain (unformatted) string content.static net.minecraft.network.chat.MutableComponentprefix()Mycel ›tag: bold wiki-red brand + faint chevron.static net.minecraft.network.chat.MutableComponentprefixed(net.minecraft.network.chat.Component message) Prepends theMycel ›tag tomessage.static net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic net.minecraft.network.chat.MutableComponentstatic inttone(net.minecraft.ChatFormatting legacy) Wiki tone standing in for a legacyChatFormattingcolor, or-1for decorations (bold, italic, ...) and reset.static net.minecraft.network.chat.MutableComponenttranslatable(String key, Object... args) static ChatVoiceMessage kit tagged withtag, e.g.static net.minecraft.network.chat.MutableComponent
-
Field Details
-
PRIMARY
public static final int PRIMARYWiki red (--accent) - brand, headers.- See Also:
-
ACCENT
public static final int ACCENTWiki blue (.tok-k) - mod names, config keys.- See Also:
-
SUCCESS
public static final int SUCCESSWiki green (.tok-s) - success.- See Also:
-
ERROR
public static final int ERRORWiki red (--accent) - errors. Always paired with a cross so it never reads as the brand.- See Also:
-
WARN
public static final int WARNWiki orange (.tok-a) - warnings / gold.- See Also:
-
INFO
public static final int INFOWiki purple (.tok-n) - values, commands.- See Also:
-
MUTED
public static final int MUTEDWiki--muted- secondary text.- See Also:
-
FAINT
public static final int FAINTWiki comment grey (.tok-c) - brackets, bullets, dividers.- See Also:
-
BODY
public static final int BODYWiki--text- body text.- See Also:
-
BRIGHT
public static final int BRIGHTWhite - names and titles that should stand out from body text.- See Also:
-
-
Method Details
-
literal
-
translatable
-
empty
public static net.minecraft.network.chat.MutableComponent empty() -
colored
@Deprecated public static net.minecraft.network.chat.MutableComponent colored(net.minecraft.network.chat.Component text, net.minecraft.ChatFormatting formatting) Deprecated.use the tone helpers (success(String), ...) orcoloredHex(Component, int)Appliesformattingto a copy oftext. Legacy colors are swapped for the nearest wiki tone, so old callers never show§colors; bold, italic and the other decorations pass through unchanged. -
tone
public static int tone(net.minecraft.ChatFormatting legacy) Wiki tone standing in for a legacyChatFormattingcolor, or-1for decorations (bold, italic, ...) and reset. -
coloredHex
public static net.minecraft.network.chat.MutableComponent coloredHex(net.minecraft.network.chat.Component text, int rgb) Applies a raw RGB color (0xRRGGBB) to a copy oftext. -
parseHex
Parses"#RRGGBB"or"RRGGBB"into0xRRGGBB.- Throws:
IllegalArgumentException- when the text is not a hex color
-
hex
-
hex
Hex-colored literal from a raw RGB int (0xRRGGBB). -
-
accent
-
success
-
error
-
warn
-
infoText
-
muted
-
faint
-
body
-
green
-
red
-
gray
-
gold
-
voice
-
msg
A message from parts: strings become body text, components are appended as they are.msg(name, " came running.") -
prefix
public static net.minecraft.network.chat.MutableComponent prefix()Mycel ›tag: bold wiki-red brand + faint chevron. -
prefixed
public static net.minecraft.network.chat.MutableComponent prefixed(net.minecraft.network.chat.Component message) Prepends theMycel ›tag tomessage. -
ok
Success line: green check + message. -
fail
Error line: red cross + message. -
note
Info line: plain message after the tag. -
caution
Warning line: orange bang + message. -
header
Header line opening a multi-line reply: tag + bright title. -
header
-
item
public static net.minecraft.network.chat.MutableComponent item(net.minecraft.network.chat.Component content) Indented row under aheader(String): faint bullet + content, no tag. -
detail
Indented continuation line (descriptions, hints) under anitem(Component). -
divider
public static net.minecraft.network.chat.MutableComponent divider()Faint divider used between sections. -
keyValue
-
keyValue
public static net.minecraft.network.chat.MutableComponent keyValue(String key, net.minecraft.network.chat.Component value) key: value pair with a pre-built value component. -
join
public static net.minecraft.network.chat.MutableComponent join(String separator, Collection<? extends net.minecraft.network.chat.Component> parts) Joins components with a literal separator. -
plain
Plain (unformatted) string content.
-
success(String), ...) orcoloredHex(Component, int)