Skip to content

Bump Java to 21 and Spigot target to 1.21.11#252

Merged
tastybento merged 3 commits into
developfrom
copilot/sub-pr-247-yet-again
Mar 22, 2026
Merged

Bump Java to 21 and Spigot target to 1.21.11#252
tastybento merged 3 commits into
developfrom
copilot/sub-pr-247-yet-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Spigot/Paper 1.21.x artifacts require Java 21; building against them with <java.version>17</java.version> causes unsupported class file version errors. Aligns all version properties to be mutually consistent.

Changes

  • java.version: 1721
  • spigot.version: 1.21.8-R0.1-SNAPSHOT1.21.11-R0.1-SNAPSHOT
  • Paper API: 1.20.4-R0.1-SNAPSHOT1.21.4-R0.1-SNAPSHOT — was pinned to 1.20.4 solely to remain Java 17-compatible; that constraint is now gone
  • maven-compiler-plugin: 3.7.03.13.0 — better Java 21 support

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] [WIP] Address feedback and update Java and Spigot version for Release 1.27.2 Bump Java to 21 and Spigot target to 1.21.11 Mar 22, 2026
Copilot AI requested a review from tastybento March 22, 2026 02:39
@tastybento tastybento marked this pull request as ready for review March 22, 2026 02:45
@tastybento
Copy link
Copy Markdown
Member

@copilot Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project limits: Fatal error compiling: error: release version 21 not supported -> [Help 1]

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project limits: Fatal error compiling: error: release versi...

Fixed in 7a6a849. The CI workflow was still setting up JDK 17 — updated .github/workflows/build.yml to use JDK 21 (Temurin distribution) and bumped all action versions to v4 (actions/checkout, actions/setup-java, actions/cache).

@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit 37a2162 into develop Mar 22, 2026
3 checks passed
@tastybento tastybento deleted the copilot/sub-pr-247-yet-again branch March 22, 2026 05:41
tastybento added a commit that referenced this pull request Mar 23, 2026
* Fix sonarcloud criticals (#244)

* Add CLAUDE.md with build commands and architecture overview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix #242: enforce shulker entity limit on Paper via ShulkerDuplicateEvent

On Paper servers, CreatureSpawnEvent fires for the new shulker *after* the
original shulker has already teleported away. If the original shulker
teleports outside the island bounding box, getNearbyEntities counts N-1
shulkers instead of N, so the limit check incorrectly allows duplication
past the configured limit.

Paper's ShulkerDuplicateEvent fires *before* the original shulker teleports
and before the duplicate is created, so the island entity count is accurate.
Register PaperShulkerLimitListener when Paper is detected at runtime;
fall back to the existing CreatureSpawnEvent handling on Spigot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix CI compilation errors

- Change Paper API dependency from 1.21.8 to 1.20.4, which is the last
  version compiled for Java 17. Paper 1.20.6+ targets Java 21 (class
  version 65), which the compiler rejects under --release 17.
- Stage the remaining add_tags source files (IslandBlockCount,
  BlockLimitsListener, RecountCalculator, etc.) that Limits.java depends
  on; they were missing from the previous commit, causing NamespacedKey /
  Material type mismatches in CI.
- Fix @AfterEach (JUnit 5) -> @after (JUnit 4) in the three test files
  that have JUnit 4 imports; the annotation was unresolved in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Incorporate log-limits-on-join setting from master

Add isLogLimitsOnJoin() config option (from master commit bdf41ea) so
that the verbose per-permission log lines can be silenced. Wraps each
addon.log() call in checkPerms/runNullCheckAndSet with the guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix SonarCloud CRITICAL issues: reduce cognitive complexity and duplicate literals

- Extract ISLAND_PLACEHOLDER constant in Limits.java (6 occurrences of "_island_")
- Extract UNKNOWN_PLAYER/NO_ISLAND/UNKNOWN_MATERIAL constants in OffsetCommand.java
- Extract handlePipelineResult() in CalcCommand to reduce cognitive complexity
- Extract logIfEnabled() and applyAmbiguousLimit() in JoinListener to reduce complexity
- Extract collectIslandGroupLimits(), applyGlobalGroupLimits(), updateGroupLimitsFromIbc(),
  checkGroupLimits() in EntityLimitListener to reduce atLimit() complexity from 23 to ~10
- Extract isGolemHead(), eraseGolemIfArmsMatch(), isWitherHead(), eraseWitherIfArmsMatch()
  in EntityLimitListener to reduce detectIronGolem/detectWither complexity
- Break Pipeliner<->RecountCalculator class cycle by replacing Pipeliner parameter in
  RecountCalculator.scanIsland() with functional interfaces (LongSupplier, Runnable, BooleanSupplier)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix BlockFormEvent handler to track material transitions for copper chest oxidation/waxing (#246)

* Initial plan

* Fix copper chest oxidation and waxing not updating block limit counts

When copper chests oxidize or are waxed with honeycomb, the BlockFormEvent
handler now properly handles the material transition by removing the old
block state count and adding the new block state count.

Added overloaded process(Block, BlockData, boolean) method to support
processing with block data different from the block's current data.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/86aebdc8-0a0e-414d-a489-33caf8d9beb4

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>

* Update src/main/java/world/bentobox/limits/objects/IslandBlockCount.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/main/java/world/bentobox/limits/objects/IslandBlockCount.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix pom.xml build.version to match Release 1.27.2 (#251)

* Initial plan

* Fix build.version in pom.xml to match PR title (1.28.0 → 1.27.2)

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/7667d74f-edbf-43b7-ae30-538a7089f8e2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>

* Guard against NPE from NamespacedKey.fromString() returning null in loadLimits() (#249)

* Initial plan

* Add null check for NamespacedKey.fromString() to prevent NPE on invalid config keys

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/56d41e06-a992-4918-ab51-e628761ed89e

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>

* Fix loadLimits() to reject non-block and uncountable materials (#250)

* Initial plan

* Fix loadLimits() to only accept block materials and skip DO_NOT_COUNT entries

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/5f78316a-24c1-42fc-81ba-d8cc8c6a52bb

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>

* Bump Java to 21 and Spigot target to 1.21.11 (#252)

* Initial plan

* Bump Java to 21, Spigot to 1.21.11, update Paper API and compiler plugin

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/511560f5-439c-478b-a893-e818934a00fe

* Fix CI: update workflow to use JDK 21 (Temurin) and bump action versions to v4

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/026bbbf3-4059-4e06-a02e-e18e52f9c749

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>

* Migrate JoinListenerTest from JUnit 4 + PowerMock to JUnit 5 + Mockito

Fixes merge conflict breakage where this test file retained JUnit 4 and
PowerMock imports/annotations that were removed in the JUnit 5 migration.

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

* Migrate from custom ServerMocks to MockBukkit

Replace the custom ServerMocks utility with MockBukkit, aligning with
the standardized test infrastructure used across the BentoBox ecosystem.

- Add MockBukkit v1.21-SNAPSHOT dependency (via jitpack.io)
- Switch from spigot-api to paper-api (required by MockBukkit)
- Replace ServerMocks.newServer()/unsetBukkitServer() with
  MockBukkit.mock()/unmock() in all 12 test files
- Remove manual server stubs that MockBukkit handles natively
  (scheduler, plugin manager, item factory, unsafe values)
- Delete ServerMocks.java and the mocks/ package
- Add compiler --add-exports args and -XX:+EnableDynamicAgentLoading

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants