Release 1.27.2#247
Conversation
* 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>
…hest 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>
There was a problem hiding this comment.
Pull request overview
This PR updates the Limits addon for a new release by migrating block limit tracking from Material to NamespacedKey (enabling tag-based limits), improving limit enforcement for shulker duplication on Paper, and refreshing build/config/docs.
Changes:
- Migrate block count/limit storage, placeholders, UI, calculators, and tests to use
NamespacedKeyinstead ofMaterial. - Add optional Paper listener to enforce entity limits on
ShulkerDuplicateEvent. - Update config defaults/documentation and bump dependency/build versions.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/world/bentobox/limits/JoinListenerTest.java | Updates tests to assert NamespacedKey-based block limits. |
| src/main/resources/config.yml | Adds AOneBlock gamemode and documents tag-like limit keys. |
| src/main/java/world/bentobox/limits/objects/IslandBlockCount.java | Switches block maps to NamespacedKey and updates limit/count APIs. |
| src/main/java/world/bentobox/limits/listeners/PaperShulkerLimitListener.java | New Paper-only listener to cancel shulker duplication when at limit. |
| src/main/java/world/bentobox/limits/listeners/JoinListener.java | Refactors permission parsing and applies block limits via material.getKey(). |
| src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java | Refactors golem/wither detection and restructures group limit resolution. |
| src/main/java/world/bentobox/limits/listeners/BlockLimitsListener.java | Loads limits by NamespacedKey (material or tag), updates counting to NamespacedKey. |
| src/main/java/world/bentobox/limits/Limits.java | Registers Paper listener conditionally; registers block placeholders using NamespacedKey. |
| src/main/java/world/bentobox/limits/commands/player/LimitTab.java | Updates panel material limits display to handle NamespacedKey entries. |
| src/main/java/world/bentobox/limits/commands/player/LimitPanel.java | Updates material limits map type to NamespacedKey. |
| src/main/java/world/bentobox/limits/commands/admin/OffsetCommand.java | Uses constants for message keys; offsets now use material.getKey(). |
| src/main/java/world/bentobox/limits/commands/admin/CalcCommand.java | Extracts pipeliner result handling into a helper method. |
| src/main/java/world/bentobox/limits/calculators/Results.java | Tracks block recount results via NamespacedKey multiset. |
| src/main/java/world/bentobox/limits/calculators/RecountCalculator.java | Uses NamespacedKey for recount; decouples scan loop from Pipeliner. |
| src/main/java/world/bentobox/limits/calculators/Pipeliner.java | Adapts to new RecountCalculator.scanIsland(...) callback signature. |
| pom.xml | Bumps Spigot/build versions; adds Paper repo + optional Paper API dependency. |
| CLAUDE.md | Adds repository build/test guidance and architecture notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@tastybento I've opened a new pull request, #249, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@tastybento I've opened a new pull request, #250, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@tastybento I've opened a new pull request, #251, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@tastybento I've opened a new pull request, #252, to work on those changes. Once the pull request is ready, I'll request review from you. |
* 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>
…oadLimits() (#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>
* 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>
* 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>
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>
#255) * Initial plan * Fix copper chest limit bypass via waxing/scraping/golem creation - Normalize all copper chest variants to COPPER_CHEST in fixMaterial() so waxing, scraping, and oxidation do not bypass placement limits - Fix BlockFormEvent handler to cancel transitions when new state exceeds limits and avoid double-processing with EntityBlockFormEvent - Fix EntityBlockFormEvent handler to properly track old→new state transitions instead of only adding blocks - Fix EntityChangeBlockEvent handler to track new block state for non-AIR transitions (e.g., copper golem creation) - Add SpawnReason.BUILD_COPPERGOLEM to entity limit checks - Add COPPER_WALL_TORCH → COPPER_TORCH normalization - Add 9 unit tests for new fixMaterial mappings Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com> Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/0363f571-f917-49e4-9bd0-7c818eac7a91 * Resolve git merge conflict markers in pom.xml from develop branch The develop branch had unresolved conflict markers from a master merge committed directly. Merging develop into our branch and resolving: - properties: keep paper.version (spigot-api replaced by paper-api) - dependencies: remove duplicate optional paper-api block - compiler plugin: use version 3.14.1 from master Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com> Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/67713724-b5bf-4594-ae25-6aad1ed30868 * Fix merge conflict markers in JoinListenerTest.java Resolve conflict between develop (ServerMocks) and master (MockBukkit) by keeping MockBukkit.unmock() since ServerMocks was removed in the MockBukkit migration. Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com> Agent-Logs-Url: https://github.com/BentoBoxWorld/Limits/sessions/05637b38-6c5f-4b64-a852-2c344a9911d0 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
…lem limiting. Fixes #256
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ner.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ner.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Wire up IslandsManager, Island mocks, and game mode world stubs so event-handler tests can exercise code paths beyond the early return. Add mockBlock() and mockEntity() helper methods for future tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover BlockPlaceEvent, BlockBreakEvent, BlockMultiPlaceEvent, and PlayerInteractEvent handlers with tests for counting, limit enforcement, DO_NOT_COUNT filtering, game-mode-world gating, metadata ignore flag, and turtle egg non-physical action handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover BlockBurnEvent, BlockFadeEvent, LeavesDecayEvent, BlockSpreadEvent, BlockFromToEvent (non-liquid ignored), EntityBlockFormEvent (skipped by BlockFormEvent handler), and IslandDeleteEvent (map removal + DB delete). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover sugar cane and bamboo cascade removal, redstone wire/wall torch attached-block cleanup, center-block ignore on placement, turtle egg physical interaction, and batch decrement from block/entity explosions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover EntityChangeBlockEvent to-AIR decrement, liquid flow destroying redstone, three-tier limit resolution (island > world > default), island offset increasing effective limit, and async save threshold trigger at CHANGE_LIMIT boundary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover CreatureSpawnEvent skip for shoulder entities, non-Villager breeding, and outside-game-mode worlds. Test spawn island exemption, spawner spawn cancellation without player notification, null-player HangingPlaceEvent early exit, and op player breeding bypass. Fix location.getWorld() stub needed by event handler world checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover creature spawn at-limit cancellation, Villager breeding check, debounce logic for creatures and vehicles, minecart limit enforcement, hanging entity limit with op bypass, and entity group limit enforcement at and under threshold. Add User/locales/IWM setup for notification and permission checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add hard tests for BlockFormEvent, EntityBlockFormEvent, BlockGrowEvent, and EntityChangeBlockEvent covering dual-material counting, cancellation with count restoration, block data restore on grow cancel, and farmland trampling with crop removal. Update CLAUDE.md testing section: fix outdated JUnit 4/PowerMock refs to JUnit 5/Mockito 5/MockBukkit, document test infrastructure setup, mock chains, helpers, Paper API BlockData.clone() gotcha, and reflection patterns for private fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|



No description provided.