Compile against Paper 26.2 now that MockBukkit supports it - #3067
Merged
Conversation
The Paper pin sat at the 26.1.2 dev bundle for one reason: MockBukkit
had no 26.2 artifact, so the API under test could not match the API
compiled against. MockBukkit 4.116.1 ships mockbukkit-v26.2, built
against 26.2.build.111-stable, so the reason is gone.
26.2 brings Adventure 5, which needed three test fixes:
- ClickEvent is now generic and carries a typed payload, so
click.value() becomes click.payload() as ClickEvent.Payload.Text.
- Component is sealed, so Mockito can no longer mock it. Two tests
passed a mocked Component as a join/quit message; they use a real
empty component now.
Main code compiled unchanged. Whole suite green at 3462 tests.
Note for the release: those two are exactly what an addon will hit if it
recompiles. A survey of 59 local addon repos found none affected — 41
never touch Adventure, and of the 18 that do, none call anything
Adventure 5 removed — but third-party addons calling ClickEvent.value()
or mocking Component in their tests will need the same edits.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp
|
tastybento
added a commit
that referenced
this pull request
Aug 15, 2026
Now that the build compiles against 26.2 (#3067), EntityType.SULFUR_CUBE is a real compile-time symbol, so the code that worked around its absence can go. The three SULFUR_CUBE fields go back to static final. They were left non-final, with a Sonar suppression each, only so tests could reflectively inject a stand-in — the JVM constant-folds static final fields, which defeated that. The tests no longer need the trick: they use EntityType.SULFUR_CUBE directly and the getStaticField / setStaticField helpers and MAGMA_CUBE stand-ins are gone with it. Also corrects .claude/rules/build-toolchain.md, which still described the old 26.1.2 compile target, told readers to use the mockbukkit-v26.1.2 coordinate, and said this work was parked in a draft PR. 3462 tests, no failures. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp
This was referenced Aug 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The Paper pin sat at the 26.1.2 dev bundle for one reason, recorded in
build.gradle.kts: MockBukkit had no 26.2 artifact, so the API under test could not match the API compiled against. MockBukkit 4.116.1 shipsmockbukkit-v26.2, built against26.2.build.111-stable. That reason is gone.paperVersion→26.2.build.111-stable(the exact bundle MockBukkit was built against)mockBukkitVersion→4.116.1, artifact →mockbukkit-v26.2Main code compiled unchanged. Full suite green: 3462 tests.
Adventure 5
26.2 brings Adventure 5, which needed three test fixes — and these are the interesting part of this PR, because they are what addon authors will hit:
ClickEventis now generic with a typed payload.click.value()→click.payload() instanceof ClickEvent.Payload.Text.ClickEvent.Actionis also no longer an enum, sovalues()/valueOf()are gone (==comparison still works).Componentis sealed, so Mockito cannot mock it. Two tests passedmock(Component.class)as a join/quit message; they now use a realComponent.empty(). Note this fails at runtime, not compile time — a build won't catch it, only running the tests will. 77 Adventure types are sealed in 5, includingTextComponent,Style,BossBar,Title,Book,Soundand the builders.Blast radius for addons
I diffed
adventure-api4.26.1 against 5.2.0 to get the real removal list rather than working from what this PR happened to hit. The removals an addon could plausibly call:ClickEvent.value()payload()ClickEvent.Action.values()/valueOf()BossBar.percent(),MIN/MAX_PERCENTprogress()TranslatableComponent.args()arguments()Component.replaceFirstText(),TextComponent.ofChildren()TranslationRegistry,MessageType,Audience.sendMessage(Identity, …)Title.Times.of(),HoverEvent.ShowItem/ShowEntity.of(),NamedTextColor.ofExact(),TextDecoration.as()Surveyed 59 local addon repos against that list: 41 never touch Adventure, and of the 18 that do, none use anything that was removed. (The detector was validated by pointing it at this repo pre-fix, where it found exactly the three real breakages and nothing else.) TradeWinds is the only addon using Adventure's own
BossBar, and it already callsprogress().Caveats worth keeping in mind: that survey covers local checkouts only, not third-party addons. And it covers recompiles — an addon jar built against Adventure 4 that calls a removed method already breaks at runtime on a 26.2 server today, since Adventure 5 arrives with the server rather than with BentoBox. This PR does not change that.
Suggested release note: call out the two concrete edits above (
ClickEvent.value()→payload(), and mockedComponentin tests), since those are what a third-party author will actually run into.🤖 Generated with Claude Code
https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp