SignGUI icon indicating copy to clipboard operation
SignGUI copied to clipboard

[Bug] Adventure lines, should apply Component from kyori library.

Open imDMK opened this issue 7 months ago • 3 comments

API version

2.5.2

Server software and version

1.21.5

Steps to reproduce

1. Use #setAdventureLines/#setAdventureLine

Expected behaviour

  1. Use #setAdventureLines/#setAdventureLine
  2. 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

imDMK avatar Jun 02 '25 11:06 imDMK

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.

Rapha149 avatar Jun 02 '25 14:06 Rapha149

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.

imDMK avatar Jun 02 '25 16:06 imDMK

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.

Rapha149 avatar Jun 02 '25 16:06 Rapha149