Skip to content

Bundle private Adventure NBT for legacy disc reads - #2

Merged
ParadauxIO merged 1 commit into
feature/paper-26.3-modernizationfrom
fix/bundle-adventure-nbt
Oct 25, 2026
Merged

ParadauxIO merged 1 commit into
feature/paper-26.3-modernizationfrom
fix/bundle-adventure-nbt

Conversation

@ParadauxIO

Copy link
Copy Markdown

Why?

The Paper 26.3 modernization branch reads historical disc tags using Adventure NBT, but declares it compileOnly. When a disc has no modern PDC value and the server does not expose Adventure NBT, the fallback fails with:

java.lang.NoClassDefFoundError: net/kyori/adventure/nbt/BinaryTagIO
    at com.minecraftcitiesnetwork.musicbox.utils.nbt.BukkitNbtHandler.getNbt(BukkitNbtHandler.java:32)

The existing tests supply NBT directly, which hides this packaging failure. This targets feature/paper-26.3-modernization because the original master implementation does not use this reader; it is a focused follow-up to #1.

How?

Bundle Adventure NBT and relocate it under MusicBox's private package. The reader logic and persisted item format remain unchanged.

Add a packaged-JAR regression test whose classloader refuses external net.kyori.adventure.nbt classes and loads the handler from the actual shaded artifact. It checks modern PDC precedence, migrated custom data, legacy tags, absent/malformed data, and writes that preserve the original item. The test fails with the original packaging (NoClassDefFoundError) and passes with this fix.

Validation: ./gradlew :plugin:test build on Java 25 passes all 24 tests. Equivalent packaged code also passed modern and legacy item reads on a running Paper 26.3 server. Audible playback was not exercised.

Diagram

Not applicable: this changes dependency packaging, with no change to the disc-reading flow.

Screenshots

Not applicable: dependency packaging and item-data regression tests have no visual output.

@ParadauxIO
ParadauxIO merged commit b416e86 into feature/paper-26.3-modernization Oct 25, 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.

1 participant