adventure-platform
adventure-platform copied to clipboard
NoSuchMethodError due to BossBar.setTitle(String) incompatibility with BungeeCord's BaseComponent update
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.