Skip to content

fix(bungee): remove adventure-platform to prevent Adventure 4.x/5.x class conflict - #642

Merged
jonesdevelopment merged 14 commits into
jonesdevelopment:mainfrom
fegmbh-rrg:fix/bungee-adventure-conflict
Oct 13, 2026
Merged

jonesdevelopment merged 14 commits into
jonesdevelopment:mainfrom
fegmbh-rrg:fix/bungee-adventure-conflict

Conversation

@fegmbh-rrg

@fegmbh-rrg fegmbh-rrg commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #623

Problem

On BungeeCord, Sonar fails to enable with:

java.lang.NoSuchMethodError: 'java.util.Optional xyz.jonesdev.sonar.libs.kyori.adventure.util.Services.service(java.util.ServiceLoader, java.lang.Class)'

Two different Adventure versions end up in the same relocated package xyz.jonesdev.sonar.libs.kyori:

  • adventure-platform-bungeecord 4.4.1 is bundled into Sonar-Bungee.jar (and pulls in Adventure 4.x, including Services).
  • LibraryLoader additionally downloads Adventure 5.2.0 (MiniMessage, Gson serializer, NBT) via Libby.

MiniMessageImpl (5.2.0) then calls Services.service(ServiceLoader, Class), which only exists in 5.x, but resolves Services from the jar (4.x).
Paper and Velocity are not affected because they ship Adventure themselves.

Changes

  • Remove adventure-platform-bungeecord from the bungeecord module.
  • Add BungeeAudience, a small Audience implementation on top of BungeeCord's native chat API
    (sendMessage, sendActionBar, showTitle). Components are serialized to JSON and passed to
    BungeeCord's ComponentSerializer. Hex colors are downsampled for clients below 1.16, as before.
  • SonarBungee#audience / #sender now return BungeeAudience.
  • LibraryLoader: on BungeeCord, resolve the transitive dependencies of the Adventure libraries
    (e.g. adventure-api, adventure-key), which previously came from adventure-platform. Gson is excluded
    because BungeeCord already provides it.
  • Second commit: restore the adventure-platform-bukkit entry in libs.versions.toml.
    bukkit/build.gradle.kts references it, but it was missing on main, so the project did not build.

Testing

  • ./gradlew build-sonar succeeds
  • Sonar-Bungee.jar contains no Adventure classes (unzip -l ... | grep -i kyori)
  • Sonar starts on BungeeCord without errors (with a fresh plugins/Sonar/lib/)
  • Command output, chat notifications, title and action bar work (/sonar, /sonar notify, /sonar verbose)
  • Tested with a client below 1.16 (hex color downsampling)

Tested on: <BungeeCord/Waterfall version, Java version, Minecraft client version>

Not covered

The Bukkit module has the same pattern (adventure-platform-bukkit 4.4.1 bundled, Adventure 5.2.0 loaded via Libby).
I did not change or test it in this PR.

AI disclosure (per CONTRIBUTING.md)

  • Tool/model: Claude Sonnet 5.5 (Claude Code)
  • Nature of use: root-cause analysis of the issue, and a first draft of the patch (BungeeAudience, LibraryLoader and build changes).
    I reviewed the code, built it and tested it myself as described above.
  • Prompts: <paste your relevant prompts here, e.g. "What would need to change in the source code to fix this error? I would like to contribute" and the follow-up asking for the patch>

@jonesdevelopment jonesdevelopment self-assigned this Oct 11, 2026
@jonesdevelopment

Copy link
Copy Markdown
Owner

Gonna take a look once I'm home; thank you for your contribution!

@fegmbh-rrg

Copy link
Copy Markdown
Contributor Author

Thank you!

Removed adventure-platform-bukkit dependency from libs.versions.toml
@fegmbh-rrg

Copy link
Copy Markdown
Contributor Author

I forgot to fix it also for Spigot

Comment thread bungeecord/src/main/java/xyz/jonesdev/sonar/bungee/BungeeAudience.java Outdated
Comment thread bungeecord/src/main/java/xyz/jonesdev/sonar/bungee/BungeeAudience.java Outdated
Comment thread bungeecord/src/main/java/xyz/jonesdev/sonar/bungee/BungeeAudience.java Outdated
@jonesdevelopment

Copy link
Copy Markdown
Owner

Your changes are currently failing the CI pipeline due to the removal of net.kyori:adventure-platform-bukkit from libs.version.toml.

@fegmbh-rrg

Copy link
Copy Markdown
Contributor Author

I have edited the sections you commented on and removed the line for Bukkit. I hope it works now!

@jonesdevelopment

Copy link
Copy Markdown
Owner

The current version is failing to load on BungeeCord due to https://mclo.gs/Tul69BA.

I don't have the time to look into this at the moment, so I'd like to ask someone else to investigate.

@jonesdevelopment

Copy link
Copy Markdown
Owner

Please test your changes before asking for a (re-)review.

@fegmbh-rrg

Copy link
Copy Markdown
Contributor Author

The current version works in my environment.

@jonesdevelopment jonesdevelopment left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonesdevelopment
jonesdevelopment merged commit 7b2d2db into jonesdevelopment:main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BungeeCord: NoSuchMethodError caused by mixed Adventure 4.x / 5.2.0 classes

2 participants