Add block group limits#287
Merged
Merged
Conversation
1391c67 to
24ab79b
Compare
Completes #12: entity groups shipped earlier; this adds the block half. A blockgrouplimits config section (mirroring entitygrouplimits) defines named groups of materials sharing one limit - the counts of all members are summed and checked at placement, so players cannot dodge a limit by converting between related blocks (grass->dirt, #132) or splitting across variants (piston/sticky piston, #84). - Settings parses group definitions plus blockgrouplimits-nether/-end per-environment limit overrides; member names normalise through the existing variant map. - checkLimit consults groups after the individual limit cascade, so a tighter individual limit still applies inside a group. - The recount tracks group members even when they have no individual limit, and the limits GUI shows a row per group (icon, member list, summed count/limit). Fixes #12 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB
24ab79b to
2f8d8ce
Compare
|
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.



Fixes #12 — the block half of group limits (entity groups shipped earlier). This is what #84 (piston + sticky piston) and #132 (grass→dirt conversion bypass) were closed into.
Config
Mirrors
entitygrouplimitsexactly: named group, icon, member list, shared limit, per-environment overrides (limit only). Member names normalise through the existing variant map, so e.g. a piston head resolves to its piston.Behaviour
process()— grow, spread, form), the counts of all group members are summed and checked against the group limit. Converting grass→dirt no longer escapes the limit because both count into the same pool.Notes / deliberate v1 scope
process()'s int-return contract reworked across all state-transition handlers — worth doing separately if wanted.<gm>.island.limit.<groupname>.<n>) and group offsets are not included; both needIslandBlockCountdata-model additions and can follow if there's demand.Tests
Settings parsing (definitions, env overrides, unknown material, undefined-group override), group-full cancels without double-count, under-limit allows and counts, tighter individual limit still applies. Full suite green (262).
In-game test plan
Pistonsgroup above, restart, place 6 pistons + 4 sticky pistons./is limitsshows a Pistons row at 10/10.blocklimits: PISTON: 3as well → the 4th piston is blocked even with the group at 7/10./is limits recount→ group count matches reality (including blocks placed before the group existed).-netheroverride at 5, verify the pool is 5 there and 10 in the overworld.🤖 Generated with Claude Code
https://claude.ai/code/session_015dbJyrv2uxHfTmiWkqGUJB