mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
chat components: reduce memory footprint for empty messages
This commit is contained in:
parent
8660e0a611
commit
8f780596ab
@ -79,12 +79,12 @@ interface ChatComponent {
|
||||
|
||||
|
||||
companion object {
|
||||
val EMPTY = ChatComponent.of("")
|
||||
val EMPTY = TextComponent("")
|
||||
|
||||
@JvmOverloads
|
||||
fun of(raw: Any? = null, translator: Translator? = null, parent: TextComponent? = null, ignoreJson: Boolean = false, restrictedMode: Boolean = false): ChatComponent {
|
||||
if (raw == null) {
|
||||
return BaseComponent()
|
||||
return EMPTY
|
||||
}
|
||||
if (raw is ChatComponent) {
|
||||
return raw
|
||||
|
Loading…
x
Reference in New Issue
Block a user