Separate block and entity limits per dimension (fixes #43)#261
Merged
tastybento merged 1 commit intodevelopfrom May 6, 2026
Merged
Separate block and entity limits per dimension (fixes #43)#261tastybento merged 1 commit intodevelopfrom
tastybento merged 1 commit intodevelopfrom
Conversation
Track block counts, entity counts, limits, and offsets independently per World.Environment so overworld, nether, and end no longer share a single count. Counts are now persistent rather than derived from getNearbyEntities, so they stay accurate when nether/end chunks are unloaded — the original bug in #43. - IslandBlockCount: every map keyed by Environment first; legacy data migrates lazily into Environment.NORMAL on first access. - BlockLimitsListener: env-aware tracking; resolution priority is island-env, world-named, env-default. New blocklimits-nether and blocklimits-end config sections override the env default for one env each. - EntityLimitListener: persistent per-env counts maintained via spawn-handler increments and EntityRemoveEvent decrements (UNLOAD cause excluded so chunk unload doesn't drop the count). EntityPortalEvent migrates counts between envs to prevent the obvious portal exploit. - JoinListener: permission format extended. 5-segment perms still apply the limit to all envs independently; new 6-segment form '<gm>.island.limit.<env>.<KEY>.<N>' targets one env (overworld/nether/end). - LimitPanel: one tab per env (skipped for envs the gamemode doesn't generate). LimitTab reads counts from the IBC. - Placeholders: env-suffixed variants added (_overworld_count etc.); the unsuffixed forms remain as sums for back-compat. - RecountCalculator: rebuilds counts per-env, including a loaded-entity scan to seed migrated servers' nether/end entity counts. - Tests: 230/230 passing, including new coverage for migration, env-prefixed perms, env-isolated counts, and per-env panel display. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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.



Summary
World.Environment(overworld / nether / end). AHOPPER: 10limit means 10 in each env — 30 total — instead of 10 shared.EntityRemoveEvent/EntityPortalEventlisteners) so the panel reads correctly even when nether/end chunks are unloaded — the original bug in Limits don't show count in nether island or end island #43.blocklimits-nether,blocklimits-end,entitylimits-nether,entitylimits-end,entitygrouplimits-nether,entitygrouplimits-end.<gm>.island.limit.<env>.<KEY>.<N>targets one env. Existing 5-segment perms apply the limit independently to every env./<gm> limitsshows one tab per env (skipped if the gamemode doesn't generate that env). New env-suffixed PlaceholderAPI variants_overworld_count,_nether_count,_end_count(and_limit,_base_limit); the unsuffixed forms remain as cross-env sums for back-compat.Environment.NORMALon first access; existing servers should run/<gm> admin limits calc <player>to redistribute counts.Test plan
mvn test— 230/230 passing (was 222 before; +8 new tests for migration, env-prefixed perms, env-isolated counts, per-env panel display)./is limits, hopper placement increments only the active env's count, panel title and icons reflect the env.IslandBlockCountdata. The legacy data is moved toNORMALonly — admins may need to run/admin limits calcto repopulate nether/end counts that were previously lumped together.EntityRemoveEvent.Cause.UNLOADexclusion is correct (we don't decrement on chunk unload)./offsetadmin command should grow an env-specific variant (currently it writes the same offset to all envs uniformly viasetBlockLimitsOffsetAllEnvs).🤖 Generated with Claude Code