ericgrandt / TotalEconomy

All in one economy plugin for Minecraft.
https://ericgrandt.github.io/TotalEconomy/
MIT License
32 stars 33 forks source link

Avoid the use of Adventure Text in common package #421

Closed ericgrandt closed 1 week ago

ericgrandt commented 2 months ago

This prevent the plugin from working with SpongeForge.

Related: https://github.com/ericgrandt/TotalEconomy/issues/420

ericgrandt commented 2 months ago

https://github.com/ericgrandt/TotalEconomy/blob/e0232267b63265579a27de2d6c0bd6ea972e21c0/totaleconomy-common/src/main/java/com/ericgrandt/totaleconomy/common/game/CommonSender.java#L6

We'll need to use a String instead of a Component and remove net.kyori.adventure from the common dependencies. The Sponge and Bukkit implementations, since they're both bundled with net.kyori.adventure, can use something like LegacyComponentSerializer.legacyAmpersand().deserialize(message). This should work, though not tested yet.

Phoenix616 commented 1 month ago

adventure-platform has a sponge adapter so you could still use it: https://github.com/KyoriPowered/adventure-platform/tree/main/platform-spongeapi

ericgrandt commented 3 weeks ago

Simple fix seems to be to exclude net.kyori when shadow jarring the Sponge plugin; this avoids the duplicate classes and uses the one built into Sponge. Still doing testing, but so far things seem to be working for both SpongeForge and Vanilla