[Bug] Adventure lines, should apply Component from kyori library.
API version
2.5.2
Server software and version
1.21.5
Steps to reproduce
1. Use #setAdventureLines/#setAdventureLine
Expected behaviour
- Use #setAdventureLines/#setAdventureLine
- Components are applied to sign
What is actually happening?
These methods, should apply for Component kyori. This is the support for adventure API.
Code snippets
No response
Any additional comments?
No response
Do you mean that the method uses the parameter type Object instead of Component?
If yes: right now I don't know why I did that but I must have had a reason for it. I will look further into it later.
No, in the API you use Object as a parameter, which is fine — but in the version-specific implementation, you're using Component from net.minecraft, not from kyori. That's why Kyori components don't work.
I don't exactly understand what you mean, I convert the kyori components to net.minecraft components using a class from Paper here: https://github.com/Rapha149/SignGUI/blob/18926ad44c36ae3e805ea93aa9f6506c23d327d8/Mojang1_21_R4/src/main/java/de/rapha149/signgui/version/MojangWrapper1_21_R4.java#L51
but you can, and in fact must, supply net.kyori.adventure.text.Component, otherwise the API will throw an exception.