* 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>
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:17→21spigot.version:1.21.8-R0.1-SNAPSHOT→1.21.11-R0.1-SNAPSHOT1.20.4-R0.1-SNAPSHOT→1.21.4-R0.1-SNAPSHOT— was pinned to 1.20.4 solely to remain Java 17-compatible; that constraint is now gonemaven-compiler-plugin:3.7.0→3.13.0— better Java 21 support📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.