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

Function Marshal

protocol/text/text.go:111–121  ·  view source on GitHub ↗

Marshal turns the text component to a classic color code message

(component TextComponent, codeChar rune)

Source from the content-addressed store, hash-verified

109
110// Marshal turns the text component to a classic color code message
111func Marshal(component TextComponent, codeChar rune) string {
112 var components = append([]TextComponent{component}, component.Extra...)
113
114 var text string
115 for _, comp := range components {
116 componentStyles(comp, &text, codeChar)
117 text += comp.Text
118 }
119
120 return text
121}
122
123func charColor(char rune) string {
124 switch char {

Callers

nothing calls this directly

Calls 1

componentStylesFunction · 0.85

Tested by

no test coverage detected