New Release#280
Merged
Merged
Conversation
Permission-based limits logged a "Setting login limit via perm" banner plus one line per environment for every matching permission on join, and this logging defaulted to on. On servers where owners carry many limit permissions this spammed the console on every login. - Default `log-limits-on-join` to false; document it as a debug-only toggle. - Log the per-login banner once instead of once per matching permission. - Bump version to 1.29.0 (behaviour change, not just a fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ZEmzuDykNhVyUGHLyrSAL
Quieten permission-limit join logging by default (#277)
Building a copper golem replaces its copper block with a copper chest and spawns the golem. That block swap fires no BlockPlaceEvent, so the COPPER_CHEST block limit was never checked and the count never incremented — players could build unlimited copper chests past the configured limit. Handle it on the CreatureSpawnEvent (SpawnReason BUILD_COPPERGOLEM, matched by name so the addon still links on servers < 1.21.9): - LOW priority: cancel the build and notify nearby players when the island is already at its COPPER_CHEST limit. The copper block and pumpkin are left untouched, consistent with iron golem / snowman / wither handling. - MONITOR priority: on a successful build, count the created copper chest so the limit stays enforceable and the count does not drift below reality. Adds three BlockLimitsListener helpers (getCopperChestMaterial, checkBlockLimit, addBlockCount) and tests for the at-limit, under-limit and successful-build paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
SonarCloud flagged 'block-limits.hit-limit' and '[material]' as duplicated 3 times in EntityLimitListener. Extract them into BLOCK_LIMIT_HIT and BLOCK_PLACEHOLDER constants, matching the existing ENTITY_LIMIT_HIT / ENTITY_PLACEHOLDER pattern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
Cancel copper golem build when at COPPER_CHEST limit (#276)
Brings the eight feature merges (#281-#288) into the release branch and reconciles them with develop's #276 copper golem chest limit and #277 quiet join logging: - pom.xml: master's dependency additions with develop's 1.29.0 bump. - JoinListener: the once-per-join log banner from #277 applied to the refactored mergePerms loop. - EntityLimitListener: copper golem checks grafted onto master's version; tellPlayersBlockLimit now respects show-limit-messages and uses the locale name translations, consistent with the other notify sites. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares a new release by updating the addon’s default join-limit logging behavior and adding enforcement for a copper golem build edge case where a copper block becomes a copper chest without a block-place event (issue #276).
Changes:
- Default
log-limits-on-jointofalse(config + settings + test) and clarify intent in config comments. - Add copper golem build handling to enforce the
COPPER_CHESTblock limit and keep block counts accurate. - Reduce join-permission logging spam by logging a single banner per merge operation; bump build version to
1.29.0.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/world/bentobox/limits/SettingsTest.java | Updates test expectation for new default log-limits-on-join=false. |
| src/test/java/world/bentobox/limits/listeners/EntityLimitListenerTest.java | Adds regression tests for copper golem -> copper chest limit enforcement/counting. |
| src/main/resources/config.yml | Changes default config value for join logging and updates its documentation. |
| src/main/java/world/bentobox/limits/Settings.java | Changes the default fallback for log-limits-on-join to false. |
| src/main/java/world/bentobox/limits/listeners/JoinListener.java | Logs the “setting login limit via perm” banner once per merge instead of per permission. |
| src/main/java/world/bentobox/limits/listeners/EntityLimitListener.java | Adds copper golem build special-casing to enforce COPPER_CHEST block limits and count the chest on successful builds. |
| src/main/java/world/bentobox/limits/listeners/BlockLimitsListener.java | Adds helper APIs to query/count blocks created without place events (for copper chest). |
| pom.xml | Bumps build.version to 1.29.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Addresses the Copilot review on #280: checkBlockLimit and addBlockCount (used for the copper golem's chest, which appears without a place event) bypassed the ignore-center-block exclusion that process() applies, so a build at the island center could be limited or counted when a normal placement there would not be. The comparison also has to be by block coordinates: these helpers receive entity spawn locations with fractional coordinates and yaw/pitch, which never equal the block-aligned center Location. A shared predicate now covers both helpers and processKey. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
Paper never fires EntityRemoveEvent for a dimension change: Entity.removeAfterChangingDimensions() passes a null Bukkit cause and CraftEventFactory.callEntityRemoveEvent() skips the event when the cause is null. The justPortaled guard therefore waited for an event that never comes, and its stale entry swallowed the entity's real death decrement instead — every mob that crossed a portal left a permanent +1 in the environment where it died (and the list grew unboundedly). Remove the guard: onEntityPortal alone transfers the count between environments, and the eventual death fires exactly one EntityRemoveEvent in the destination world. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
…counts Fix phantom entity counts left by portaled mobs
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Release PR for Limits 1.29.0 (bumps
build.versionfrom 1.28.4).Added by this PR (develop → master)
COPPER_CHESTblock limit. The build is now cancelled when the island is at that limit, and the chest is counted when the build proceeds. Matched by spawn-reason name so the addon still runs on servers older than 1.21.9.log-limits-on-joinnow defaults tofalse, and when enabled the per-permission log spam is reduced to a single banner per join.Also new since 1.28.4 (already merged to master, released with this)
blockgrouplimitsconfig section: one shared limit across a set of materials, with per-environment overrides. Closes the grass→dirt and piston/sticky-piston limit bypasses (Same limit for several elements #84, Players Bypassing Grass_Block Limit. (Block Group Limits would solve.) #132).apply-member-limit-permsmerges team members'island.limit.*permissions into the island's limits, highest value wins.blocklimits(ItemsAdder ids as-is, Oraxen ids asoraxen:<id>); enforcement via the plugins' own place/break events. Needs in-game verification with the real plugins — test plan in Add ItemsAdder and Oraxen custom block limits #288.%Limits_<gm>_island_reached_limits%(+ per-env variants) andLimits#getReachedLimits(...).stacked-plants-count-as-onecounts a sugar cane / bamboo column as a single plant.island.limits.materials.*/entities.*locale sections for GUI and hit-limit message names.show-limit-messages: falseenforces limits silently.New config options (all defaults preserve existing behaviour except where noted)
show-limit-messagestrueapply-member-limit-permsfalsestacked-plants-count-as-onefalseblockgrouplimits(+-nether/-end)log-limits-on-joinfalsetrueCustom block ids may now appear as quoted keys in any
blocklimitssection.Verification
295 JUnit tests pass on the merged branch. Merge conflicts between develop and master were reconciled so that #277's once-per-join banner applies to the refactored perm-merge loop, and #276's notification respects
show-limit-messagesand the locale name translations.🤖 Generated with Claude Code
https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB