Skip to content

Add per-feature config - #49

Closed
Froosty11 wants to merge 4 commits into
Patbox:masterfrom
Froosty11:feature-config
Closed

Froosty11 wants to merge 4 commits into
Patbox:masterfrom
Froosty11:feature-config

Conversation

@Froosty11

Copy link
Copy Markdown

Adds config/polydecorations.json, which lets server owners turn off individual features without needing a datapack.

Each feature can be set to:

  • true - enabled (default)
  • false - recipes are removed, but blocks and items stay registered, so existing worlds keep them. wall_lanterns and fence_leads have no recipes, so with false their interaction stops working instead.
  • "hard" - removed completely. No blocks, items, block entities or entities are registered, no Polymer block states are requested, behaviour mixins aren't applied and assets are left out of the resource pack.
{
  "features": {
    "bench": false,
    "statues": "hard"
  }
}

The file is created with everything enabled on first start, and missing keys default to true, so nothing changes unless it's edited.

How it works

  • DecorationsFeature lists the features with name patterns that match their assets, recipes, loot tables and translation keys.
  • Generated recipes and their advancements get a polydecorations:feature load condition. Loot tables get the same condition with "registered": true, so they're only dropped for hard disabled features. Tag entries of this mod are now optional.
  • A resource converter removes models, textures, item definitions, translations, sounds, font glyphs and atlas entries of hard disabled features from the Polymer pack.
  • The trapdoor/campfire Polymer states are only requested if a feature using them is registered.
  • The seat gamerule is always registered. Otherwise worlds that have it saved fail to parse their gamerules when benches and stumps are both hard disabled.

Testing

  • Datagen output has the expected conditions.
  • With every feature hard disabled, the pack goes from 1.20 MB to 123 KB and no blocks or items are registered. With a mixed config it's 625 KB.
  • Checked the filtered packs for dangling model/texture references, missing item definitions, translations and sound files. None found.
  • Joined with a vanilla client using a mixed config, including enabled features that share assets with hard disabled ones (sign posts/mailboxes, sleeping bags/tool racks, brazier/copper campfire, basket/flower pots). Everything rendered fine.
  • In-game, checked that false disables wall lantern placement (with and without sneaking), fence leads and the recipe book entries, and that they all work with true.

Unrelated, but I noticed WallAttachedLanternBlock has no default state set, so /setblock places it waterlogged.

config/polydecorations.json sets every feature to true, false or "hard".
A hard disabled feature registers none of its blocks, items, block
entities or entities, requests no Polymer block states (trapdoor/campfire
states are only requested if a feature using them is registered) and its
vanilla behaviour mixins aren't applied. With false everything stays
registered, so existing worlds keep their blocks, but the feature can't
be obtained anymore. Missing keys default to true.
Generated recipes and their advancements get a polydecorations:feature
load condition, so they only load if the feature is enabled. Loot
tables load as long as the feature isn't hard disabled. The feature is
found by entry name the same way as assets. Tag entries of this mod are
optional, so hard disabled blocks and items don't break their tags.
A resource converter drops models, textures and item definitions of
hard disabled features and removes their translations, sounds, gui font
glyphs and atlas palette entries. Sign post models of modded woods are
now written with sign posts instead of statues, so they don't depend
on statues being registered.
@Patbox

Patbox commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Yeah no

@Patbox Patbox closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants