Conversation
netcrafts
force-pushed
the
feat/and-blacklist-rules
branch
from
September 3, 2026 20:41
013f5b4 to
ef42ed6
Compare
- Add combinationBlacklist to [actions] config: each rule is an inline TOML table where ALL specified fields must match to suppress an action (AND logic). Flat blacklists are evaluated first and unchanged. - Supported fields: type, world, object, source, centerX, centerY, centerZ, range. Omitted fields are wildcards. - Area filter: all four of centerX/Y/Z + range (>= 1) must be specified together; partial spec is silently skipped. - CombinationBlacklistRule: new data class with matches() implementing AND logic and Chebyshev cube range check. - ActionsSpec: new required<List<CombinationBlacklistRule>> entry. - ActionType.isBlacklisted(): one appended clause for combination rules. - migrateConfig(): appendKeyIfMissing() inserts the new key into existing ledger.toml files on first launch after upgrade. - Style: trailing comma cleanup in AbstractActionType, MessageUtils, PageCommand.
netcrafts
force-pushed
the
feat/and-blacklist-rules
branch
from
September 3, 2026 21:08
ef42ed6 to
ac92d04
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.
What does this change?
Adds
combinationBlacklistto the[actions]config section. Each rule is an inline TOML table where all specified fields must match for an action to be suppressed (AND logic). The existing flat blacklists (typeBlacklist,objectBlacklist,sourceBlacklist,worldBlacklist) are evaluated first and are unchanged.Rules now also support an optional spatial area filter: specify
centerX,centerY,centerZ, andrangeto suppress all actions within a Chebyshev cube of the given radius around a fixed coordinate.Why?
The existing blacklists use OR logic — adding an entry to any list suppresses every action that matches that single field. This makes it impossible to express rules like "suppress snow golem snow block placements without suppressing all block-place events or all snow interactions". Equally, there is no way to suppress logging within a specific zone (e.g. a spawn protection area) without blacklisting an entire dimension.
How?
CombinationBlacklistRule— data class with optional fieldstype,world,object,source,centerX,centerY,centerZ,range. Omitted fields are wildcards.matches()returnsfalsefor an empty/all-null rule, otherwise ANDs every non-null field against the action. Theobjectfield checks bothobjectIdentifierandoldObjectIdentifier, consistent withobjectBlacklist. All four area fields (centerX/Y/Z+range >= 1) must be present together for the area check to apply; a partial spec is silently treated as no area filter.ActionsSpec— one newrequired<List<CombinationBlacklistRule>>entry.ActionType.isBlacklisted()— appends one clause at the end:migrateConfig()—appendKeyIfMissing()inserts the new key into existingledger.tomlfiles on first launch after upgrade, so users do not need to manually edit their config.Config example
Backward compatibility
Servers upgrading from an older version do not need to touch their config.
migrateConfig()writes the new key (with a commented example) automatically on the first restart after the jar is replaced.