Let disabledComponents name pack mantle stages by id and take plain strings

This commit is contained in:
piexel committed 2026-10-08 13:09:03 +02:00
1 parent 544a765137
commit dc07dafa1e
2 files changed
+6 -6

No files matched your search

@@ -8,8 +8,7 @@ import art.arcane.volmlib.util.mantle.flag.MantleFlag;
/**
* What studio offers for a dimension's {@code disabledComponents}: the flags of Iris's own mantle stages, such as
* {@code CARVED} for caves. Pack mantle stages are left out: their flags follow their position in the pack's
* stage order, so a name written today could disable another stage once the pack changes.
* {@code CARVED} for caves, then the ids of the pack's mantle stages.
*/
public class ComponentFlagFunction implements ListFunction<KList<String>> {
@Override
@@ -24,6 +23,8 @@ public class ComponentFlagFunction implements ListFunction<KList<String>> {
@Override
public KList<String> apply(IrisData data) {
return MantleStageFlags.builtIn().stream().map(MantleFlag::toString).collect(KList.collector());
KList<String> names = MantleStageFlags.builtIn().stream().map(MantleFlag::toString).collect(KList.collector());
names.addAll(MantleStageFlags.packStageIds(data.getModules().pack().mantle().stages()));
return names;
}
}
@@ -70,7 +70,6 @@ import art.arcane.iris.util.common.data.DataProvider;
import art.arcane.volmlib.util.io.IO;
import art.arcane.volmlib.util.json.JSONArray;
import art.arcane.volmlib.util.json.JSONObject;
import art.arcane.volmlib.util.mantle.flag.MantleFlag;
import art.arcane.volmlib.util.math.Position2;
import art.arcane.volmlib.util.math.RNG;
import art.arcane.iris.util.project.noise.CNG;
@@ -306,8 +305,8 @@ public class IrisDimension extends IrisRegistrant {
private int caveLavaHeight = 8;
@RegistryListFunction(ComponentFlagFunction.class)
@ArrayType(type = String.class)
@Desc("Mantle passes to skip in this dimension, by flag: CARVED (caves), OBJECT (objects), FLOATING_OBJECT (objects on floating islands) or JIGSAW (structures).")
private KList<MantleFlag> disabledComponents = new KList<>();
@Desc("Mantle passes to skip in this dimension: CARVED (caves), OBJECT (objects), FLOATING_OBJECT (objects on floating islands) or JIGSAW (structures), or the id of a pack module's mantle stage, such as example:moss/veins. A name that matches nothing is warned about and ignored.")
private KList<String> disabledComponents = new KList<>();
public int getMaxHeight() {
return (int) getDimensionHeight().getMax();