Skip to content

feat: support Minecraft 26.2 and migrate the build to Java 25#2993

Merged
tastybento merged 2 commits into
developfrom
feature/paper-26-2-support
Jun 21, 2026
Merged

feat: support Minecraft 26.2 and migrate the build to Java 25#2993
tastybento merged 2 commits into
developfrom
feature/paper-26-2-support

Conversation

@tastybento

Copy link
Copy Markdown
Member

Summary

Adds support for Paper/Minecraft 26.2 "Chaos Cubed" (now the default client version) and makes the toolchain changes its API requires. Verified green: ./gradlew build passes on Java 25 (shaded JAR + full test suite, 3217 tests, incl. 5 new Sulfur Cube tests).

Why this is bigger than a version bump

Bumping to 26.x is not a one-line change — three external constraints forced larger moves:

  • Java 25: the 26.x paper-api is Java 25 bytecode and its Gradle metadata forces consumers to Java 25. BentoBox now compiles to Java 25 (toolchain + options.release). ⚠️ Addons that compile against BentoBox must also move to Java 25.
  • paperweight: every 26.x dev bundle is data version 8, which no released paperweight (<= beta.21) can read. Uses 2.0.0-SNAPSHOT from Paper's repo (added a pluginManagement block in settings.gradle.kts); the paperweight launcher is pointed at Java 25 (paperclip needs it for 26.1+).
  • MockBukkit: there is no MockBukkit for 26.2 yet — its registry mock hard-fails on 26.2's new minecraft:sulfur_cube_archetype registry. So we compile against the newest API that has a matching MockBukkit: paperVersion = 26.1.2.build.72-stable + org.mockbukkit.mockbukkit:mockbukkit-v26.1.2:4.113.2. 26.2 is still fully supported at runtime.

Changes

Runtime 26.2 support

  • ServerCompatibility: add V26_2 (COMPATIBLE).
  • .github/workflows/modrinth-publish.yml: add 26.2 to game-versions.
  • buildVersion3.18.0.

Sulfur Cube (the only new 26.2 mob with protection implications)
Resolved via Enums.getIfPresent("SULFUR_CUBE") so the code compiles/runs on older APIs; the field is null-guarded and non-final (the JVM constant-folds static final, defeating test injection).

  • Util — classified as passive, excluded from hostile (slime-like but passive).
  • EntityInteractListener — giving a block to a cube to absorb → PLACE_BLOCKS.
  • BucketListener — picking a cube up with an empty bucket → BUCKET.
  • Shearing an absorbed cube is already covered by the generic SHEARING listener.
  • New building blocks, potent sulfur/geysers/noxious gas, the music disc and the spawn egg need no new flags (generic break/place, environmental, or existing JUKEBOX/SPAWN_EGGS).

Test fixups from the API bump (landed in 26.1.x)

  • HangingBreakByEntityEvent and VehicleDamageEvent now take a DamageSource — updated call sites in BreakBlocksListenerTest and ItemFrameListenerTest.
  • Added Sulfur Cube tests for classification, interaction and bucketing.

Docs: CLAUDE.md and build comments updated Java 21 → 25.

Temporary pins — please revisit

  • paperweight 2.0.0-SNAPSHOT (unreleased) — swap to a stable release once one supports data-version-8 bundles.
  • mockbukkit-v26.1.2 + compiling against 26.1.2 — move to 26.2 once a MockBukkit 26.2 build exists, to get compile-time SULFUR_CUBE and direct test coverage.

🤖 Generated with Claude Code

Paper/Minecraft 26.2 "Chaos Cubed" is now the default client version.
Add 26.2 support and the toolchain changes its API requires.

Build / toolchain:
- Compile against the latest stable 26.1.2 dev bundle. This is the newest
  Paper API with a matching MockBukkit release (mockbukkit-v26.1.2); MockBukkit
  has no 26.2 build yet and its registry mock hard-fails on 26.2's new
  minecraft:sulfur_cube_archetype registry. 26.2 is fully supported at runtime.
- Move to Java 25: the 26.x paper-api is Java 25 bytecode and forces consumers
  to Java 25 (toolchain + options.release). Addons compiling against BentoBox
  must also move to Java 25.
- Use paperweight 2.0.0-SNAPSHOT (via a pluginManagement Paper repo): all 26.x
  dev bundles are data version 8, which released paperweight (<= beta.21) cannot
  read. Point the paperweight launcher at Java 25 (paperclip needs it for 26.1+).
- Switch MockBukkit to org.mockbukkit.mockbukkit:mockbukkit-v26.1.2:4.113.2.
- buildVersion -> 3.18.0.

Runtime 26.2 support:
- ServerCompatibility: add V26_2 (COMPATIBLE).
- Modrinth game-versions: add 26.2.

Sulfur Cube (new 26.2 mob) protection. Resolved via Enums.getIfPresent so the
code still works on older APIs; the field is null-guarded and non-final so tests
can inject a stand-in type:
- Util: classify SULFUR_CUBE as passive and exclude it from hostile (it is
  slime-like but passive).
- EntityInteractListener: giving a block to a cube to absorb -> PLACE_BLOCKS.
- BucketListener: picking a cube up with an empty bucket -> BUCKET.
- Shearing an absorbed cube is already covered by the generic SHEARING listener.
New 26.2 building blocks, potent sulfur/geysers/gas, the music disc and the
spawn egg need no new flags (generic break/place, environmental, or existing
JUKEBOX/SPAWN_EGGS).

Test fixups required by the API bump (26.1.x):
- HangingBreakByEntityEvent and VehicleDamageEvent now take a DamageSource;
  update the call sites in BreakBlocksListenerTest and ItemFrameListenerTest.
- Add Sulfur Cube tests for the classification, interaction and bucketing paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lableLocales

The unsorted getAvailableLocales(false) list comes from File.listFiles(), whose
order is not guaranteed and varies by OS/filesystem. The test asserted fr_FR was
first, which failed on CI where en_US is listed first. Assert that both locales
are present (size + contains) instead, and keep the deterministic ordering
assertions for the sorted list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento merged commit c1bae6c into develop Jun 21, 2026
3 checks passed
@tastybento tastybento deleted the feature/paper-26-2-support branch June 21, 2026 00:37
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