adventure-platform icon indicating copy to clipboard operation
adventure-platform copied to clipboard

NoSuchMethodError due to BossBar.setTitle(String) incompatibility with BungeeCord's BaseComponent update

Open bivashy opened this issue 1 year ago • 0 comments

Description: BungeeCord 1.20-R0.2 and newer versions use BaseComponent for sending BossBar titles instead of String. If we try to send a BossBar to an audience, we will encounter an exception:

Stacktrace

java.lang.NoSuchMethodError: 'void net.md_5.bungee.protocol.packet.BossBar.setTitle(java.lang.String)'
    at net.kyori.adventure.platform.bungeecord.BungeeFacet$BossBar.bossBarNameChanged(BungeeFacet.java:258)
    at net.kyori.adventure.platform.facet.Facet$BossBar.bossBarInitialized(Facet.java:525)
    at net.kyori.adventure.platform.bungeecord.BungeeFacet$BossBar.bossBarInitialized(BungeeFacet.java:250)
    at net.kyori.adventure.platform.facet.FacetBossBarListener.bossBarInitialized(FacetBossBarListener.java:43)
    ...

We could use TextComponent.fromLegacyText(String) instead of ComponentSerializer.toString(BaseComponent[]) to match the method's syntax.

bivashy avatar Feb 17 '24 14:02 bivashy