crashdemons / DisplayItem-Spigot

rewrite of DisplayItem for use in Spigot 1.13+ (uses BungeeChat components)
5 stars 0 forks source link

1.19 #22

Closed sovtec closed 1 year ago

sovtec commented 2 years ago

I really like the idea of this plugin, is it any chance you could update it to 1.19 and support the new HoverText instead of the old depreciated one? :)

I have a feel you have a updated version, just not commited 😅

Would be epic if you could help out

crashdemons commented 2 years ago

Did you try this pre-release https://github.com/crashdemons/DisplayItem-Spigot/releases/tag/v2.9.10 ? It probably will still have deprecated code, but it has been working for us on 1.19

EDIT: I'm really trying to find any examples using the new HoverEvent method but everything I can find uses the old one instead of the Content version. I could probably use Item as the Content, but I don't see any clean way to convert ItemStack to Item without the mess I'm already doing...

EDIT2: I did find one outdated example that uses nmsItem.getTag() but it doesn't seem that CraftItemStack decided to expose that method, so we have the same problem as with nmsItem.save() where it is obfuscated differently every version...

sovtec commented 2 years ago

Seems to be working altho it's not optimal, I really like this plugin. EvModder told me about it because I talked to him about creating a plugin like this but was confused about the hover event.

Also tried looking into the HoverEvent, and I found this: BungeeCord-Chat 1.16-R0.4 API altho that might also be a little old

crashdemons commented 2 years ago

I'm using that API (just not the newest HoverEvent constructor) and I've read what little it shows, but it doesn't really answer the questions I had.

sovtec commented 2 years ago

Wish i knew how the new hover component worked lol.

Unrelated but related issue/request

I am using this on my server but players with striketrugh nicknames have the strike displayed all the way in the command send from this plugin including after it's supposed to stop.

Any sulution to this? Not super important tho.

crashdemons commented 2 years ago

This is a known issue since about 1.15/1.16 but I haven't identified why. It seems like the bungeechat formatter is ignoring the &r (reset formatting) code when a hover component is embedded.

The ticket: https://github.com/crashdemons/DisplayItem-Spigot/issues/21

One potential solution is to manually modify the chat component structure myself...

sovtec commented 2 years ago

I mean it's not an issue tho. Only moderators on my server can use strikethrough. Again love this plugin, have a nice day.