Key settings by feature id, order options as declared and declare stage reach

- Packs write settings under the feature id. @Feature(field) becomes an
  optional alias that only built-in modules may set, so existing pack JSON
  keeps loading; a pack module setting one fails the load. Reserved host
  fields now only constrain aliases. FeatureSchema exposes key and alias.
- Pack snippet names live under their module's folder
  (snippet/<namespace>/<path>/...); snippet names are folder paths.
- OptionsMetadata lists options in declaration order, read from the class
  file, a superclass's first.
- @Ref(PACK_BIOME|PACK_REGION|PACK_OBJECT) fits String only.
- Stage definitions declare reach(blocks) and writesMantle(layers);
  ResolvedGraph.reach() collects the pipeline and per-layer maximum, and
  the load fails on an unregistered or mistyped layer.
This commit is contained in:
piexel committed 2026-10-06 13:59:28 +02:00
1 parent b12e7a8c49
commit a325640d5d
38 files changed
+761 -138

No files matched your search

@@ -10,8 +10,8 @@ import java.util.Objects;
* studio completion. It holds module-provided entries only: the host describes its own fields.
*
* <p>Everything is in a fixed order, so the same modules always give the same description: features
* by id, the features of a target by JSON field, types by name, snippets by snippet name, options by
* name and enum constants in declaration order.
* by id, the features of a target by JSON key, types by name, snippets by snippet name, options and
* enum constants in declaration order.
*
* @param features every catalogued settings type of the pack's modules, built-in ones included
* @param types every class reachable from those settings, each once
@@ -22,12 +22,12 @@ public record PackSchema(List<FeatureSchema> features, List<ObjectType> types) {
types = types.stream().sorted(Comparator.comparing(ObjectType::name)).toList();
}
/** The module fields of one attachment target, by JSON field name. */
/** The module features of one attachment target, by JSON key. */
public List<FeatureSchema> fields(FeatureAttachment.Target target) {
Objects.requireNonNull(target, "target");
return features.stream()
.filter(feature -> feature.targets().contains(target))
.sorted(Comparator.comparing(FeatureSchema::field))
.sorted(Comparator.comparing(FeatureSchema::key))
.toList();
}