MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / applyStyle

Function applyStyle

protocol/text/text.go:197–213  ·  view source on GitHub ↗
(char rune, component *TextComponent)

Source from the content-addressed store, hash-verified

195}
196
197func applyStyle(char rune, component *TextComponent) {
198 if char >= '0' && char <= 'f' {
199 component.Color = charColor(char)
200 }
201 switch char {
202 case 'k':
203 component.Obfuscated = true
204 case 'l':
205 component.Bold = true
206 case 'm':
207 component.Strikethrough = true
208 case 'n':
209 component.Underlined = true
210 case 'o':
211 component.Italic = true
212 }
213}
214
215func componentStyles(component TextComponent, text *string, codeChar rune) {
216 *text += colorChar(component.Color, string(codeChar))

Callers 1

UnmarshalFunction · 0.85

Calls 1

charColorFunction · 0.85

Tested by

no test coverage detected