KyoriPowered / adventure-platform

Adventure platform implementations
https://docs.advntr.dev/platform/index.html
MIT License
175 stars 29 forks source link

Add the ability to construct a HoverEvent from items #183

Open kangarko opened 2 months ago

kangarko commented 2 months ago

Since the ItemStack class implements HoverEventSource only on modern Paper, is there a way to show it through Adventure?

With my other reports, Adventure looks like it is mostly broken for 1.7.10-1.8.8.

kangarko commented 2 months ago

Someone had to implement it by himself, can't this just be ported into adventure-platform? Especially when you advertise 1.7.10+ support.

https://github.com/FunnyGuilds/FunnyGuilds/blob/ffa1976ac2bc6e2c36e6c1ad3366483a4c6407f2/plugin/src/main/java/net/dzikoysk/funnyguilds/shared/adventure/ItemComponentHelper.java#L106

kezz commented 2 months ago

There is no such API for this at this time. If you wish to open a PR implementing this across adventure-platform, feel free! :D

kangarko commented 2 months ago

But then why Adventure claims it's 1.8.8 compatible for years when major APIs are missing? Specifically if the wiki states on all places that 1.7.10+ is supported then it should be in alignment with that statement

kezz commented 2 months ago

The Adventure API does not have any representation of an "item" and therefore there is no support for such a thing in adventure-platform. 1.7.10+ is supported, but that doesn't mean that every single element of the entire game is supported obviously. Item hover events are just one of those things that aren't natively supported in the API. Of course, you can easily construct your own item hover events using the methods provided, similar to the code you linked earlier.

Please don't change the title of this issue back as you are specifically asking for new API that does not exist to be created for all versions.

kangarko commented 2 months ago

The adventure-platform is specifically written to bridge Bukkit/Spigot/Paper to Adventure, hence I suggest the method to convert an ItemStack into the object that Adventure works with.

I changed the title intentionally because imho the logical outcome of a lack of this method is downstream incompatibility.