chat component renderer: don't emit overflow flag when message is empty

This fixes some bugs on weird servers that a lot of messages in the chat are hidden
This commit is contained in:
Bixilon 2023-01-26 21:45:56 +01:00
parent a2e8f6af90
commit 6fc6ad5a5b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2022 Moritz Zwerger
* Copyright (C) 2020-2023 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -47,7 +47,7 @@ interface ChatComponentRenderer<T : ChatComponent> {
return when (text) {
is BaseComponent -> BaseComponentRenderer.render(initialOffset, offset, size, element, context, consumer, options, renderInfo, text)
is TextComponent -> TextComponentRenderer.render(initialOffset, offset, size, element, context, consumer, options, renderInfo, text)
is EmptyComponent -> return true
is EmptyComponent -> return false
else -> TODO("Don't know how to render ${text::class.java}")
}
}