Skip to content

Compile against Paper 26.2 now that MockBukkit supports it - #3067

Merged
tastybento merged 1 commit into
developfrom
chore/paper-26.2
Aug 15, 2026
Merged

Compile against Paper 26.2 now that MockBukkit supports it#3067
tastybento merged 1 commit into
developfrom
chore/paper-26.2

Conversation

@tastybento

Copy link
Copy Markdown
Member

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 ships mockbukkit-v26.2, built against 26.2.build.111-stable. That reason is gone.

  • paperVersion26.2.build.111-stable (the exact bundle MockBukkit was built against)
  • mockBukkitVersion4.116.1, artifact → mockbukkit-v26.2
  • the two now-stale comments explaining the pin are rewritten

Main 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:

ClickEvent is now generic with a typed payload. click.value()click.payload() instanceof ClickEvent.Payload.Text. ClickEvent.Action is also no longer an enum, so values() / valueOf() are gone (== comparison still works).

Component is sealed, so Mockito cannot mock it. Two tests passed mock(Component.class) as a join/quit message; they now use a real Component.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, including TextComponent, Style, BossBar, Title, Book, Sound and the builders.

Blast radius for addons

I diffed adventure-api 4.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:

Removed Replacement
ClickEvent.value() payload()
ClickEvent.Action.values() / valueOf() no longer an enum
BossBar.percent(), MIN/MAX_PERCENT progress()
TranslatableComponent.args() arguments()
Component.replaceFirstText(), TextComponent.ofChildren() removed
TranslationRegistry, MessageType, Audience.sendMessage(Identity, …) removed
Title.Times.of(), HoverEvent.ShowItem/ShowEntity.of(), NamedTextColor.ofExact(), TextDecoration.as() removed

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 calls progress().

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 mocked Component in tests), since those are what a third-party author will actually run into.

🤖 Generated with Claude Code

https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp

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
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit 4dbecfe into develop Aug 15, 2026
3 checks passed
@tastybento
tastybento deleted the chore/paper-26.2 branch August 15, 2026 01:30
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
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