Update me.lucko:adventure-api:4.0.0 to 4.1.1
Karlatemp opened this issue ยท 3 comments
Description
LuckPerms using me.lucko:adventure-api:4.0.0
, translatable components with no args will only render translated value.
All children of the translatable component lost.
> lp info
[LP] Running
.....
Reproduction steps
- run
/lp info
Expected behaviour
[LP] Running LuckPerms vXXX by luck
Environment details
- Server type: Not Minecraft Server,
JetBrains IDEA - LuckPerms version: 0ea0ce9d268dce264a5a58138dff978a86b45459 (master)
Any other relevant details
package misc
import me.lucko.luckperms.common.locale.TranslationManager
import net.kyori.adventure.key.Key
import net.kyori.adventure.text.Component.text
import net.kyori.adventure.text.Component.translatable
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
import net.kyori.adventure.translation.GlobalTranslator
import net.kyori.adventure.translation.Translator
import java.text.MessageFormat
import java.util.*
// fun render(comp: Component) = GlobalTranslator.render(comp, Locale.getDefault())
fun main() {
val comp = translatable().key(
"test"
).append(text("FAQ"))
.build()
GlobalTranslator.get().addSource(object : Translator {
val n = Key.key("test")
override fun name(): Key = n
override fun translate(key: String, locale: Locale): MessageFormat? {
if (key == "test") return MessageFormat("test0")
return null
}
})
val translated = TranslationManager.render(comp)
println(LegacyComponentSerializer.legacySection().serialize(translated))
println(LegacyComponentSerializer.legacySection().serialize(comp))
println("=============")
println(GsonComponentSerializer.gson().serialize(translated))
println(GsonComponentSerializer.gson().serialize(comp))
}
test0
extV
=============
{"text":"test0"}
{"translate":"test","extra":[{"text":"extV"}]}
This has already been fixed, you won't be able to reproduce it using the latest version: https://luckperms.net/