Studio completes jigsaw start pools through Reference.TEMPLATE_POOL; purity allowlist tightened

SchemaBuilder renders TEMPLATE_POOL with the platform's template pools (enum-native-jigsaw-pool) and drops the
RegistryListNativeJigsawPool branches. SchemaBuilderParityTest checks a native structure's jigsaw startPool completes
them. WorldCreationProgressReporter no longer imports Bukkit, so it leaves the purity allowlist (184 entries).
This commit is contained in:
piexel committed 2026-10-10 08:05:00 +02:00
1 parent 248a087c17
commit 133fb377de
3 files changed
+27 -13

No files matched your search

-1
View File
@@ -83,7 +83,6 @@ art/arcane/iris/core/tools/IrisPackBenchmarking.java
art/arcane/iris/core/tools/IrisReflectiveAPI.java
art/arcane/iris/core/tools/IrisToolbelt.java
art/arcane/iris/core/tools/IrisWorldCreator.java
art/arcane/iris/core/tools/WorldCreationProgressReporter.java
art/arcane/iris/engine/IrisEngineEffects.java
art/arcane/iris/engine/IrisWorldManager.java
art/arcane/iris/engine/MarkerSpawnScanner.java
@@ -48,7 +48,6 @@ import art.arcane.iris.engine.object.annotations.RegistryListEntityType;
import art.arcane.iris.engine.object.annotations.RegistryListFont;
import art.arcane.iris.engine.object.annotations.RegistryListFunction;
import art.arcane.iris.engine.object.annotations.RegistryListItemType;
import art.arcane.iris.engine.object.annotations.RegistryListNativeJigsawPool;
import art.arcane.iris.engine.object.annotations.RegistryListPotionEffect;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.RegistryListSpecialEntity;
@@ -446,6 +445,7 @@ public class SchemaBuilder {
case STRUCTURE_PREFIX -> putRegistryEnumOrPrefixRef(property, "enum-vanilla-structure-or-prefix",
"enum-vanilla-structure", this::vanillaStructures, VANILLA_STRUCTURE_PREFIX_PATTERN);
case STRUCTURE_SET -> putRegistryEnumRef(property, "enum-vanilla-structure-set", this::vanillaStructureSets);
case TEMPLATE_POOL -> putRegistryEnumRef(property, "enum-native-jigsaw-pool", this::nativeJigsawPools);
case POTION_EFFECT -> putRegistryEnumRef(property, "enum-potion-effect-type", this::potionTypes);
case ENCHANTMENT -> putRegistryEnumRef(property, "enum-enchantment", this::enchantTypes);
case PACK_BIOME -> putPackResourceRef(property, IrisBiome.class);
@@ -615,11 +615,6 @@ public class SchemaBuilder {
putRegistryEnumRef(prop, "enum-block-type", this::blockTypes);
description.add(SYMBOL_TYPE__N + " Must be a valid Block Type (use ctrl+space for auto complete!)");
} else if (k.isAnnotationPresent(RegistryListNativeJigsawPool.class)) {
fancyType = "Native Jigsaw Pool";
putRegistryEnumRef(prop, "enum-native-jigsaw-pool", this::nativeJigsawPools);
description.add(SYMBOL_TYPE__N + " Must be a registered vanilla, datapack, or modded template pool key (use ctrl+space for auto complete!)");
} else if (k.isAnnotationPresent(RegistryListVanillaStructure.class)) {
fancyType = "Vanilla Structure";
putRegistryEnumRef(prop, "enum-vanilla-structure", this::vanillaStructures);
@@ -792,10 +787,6 @@ public class SchemaBuilder {
items.put("$ref", "#/definitions/" + key);
prop.put("items", items);
description.add(SYMBOL_TYPE__N + " Must be a valid vanilla, datapack, or imported Iris structure (use ctrl+space for auto complete!)");
} else if (k.isAnnotationPresent(RegistryListNativeJigsawPool.class)) {
fancyType = "List<Native Jigsaw Pool>";
putRegistryEnumItems(prop, "enum-native-jigsaw-pool", this::nativeJigsawPools);
description.add(SYMBOL_TYPE__N + " Must be a registered vanilla, datapack, or modded template pool key (use ctrl+space for auto complete!)");
} else if (k.isAnnotationPresent(RegistryListVanillaStructure.class)) {
fancyType = "List<Vanilla Structure>";
putRegistryEnumItems(prop, "enum-vanilla-structure", this::vanillaStructures);
@@ -44,6 +44,7 @@ import art.arcane.iris.engine.object.annotations.RegistryListSpecialEntity;
import art.arcane.iris.engine.object.annotations.RegistryListVanillaStructure;
import art.arcane.iris.engine.object.annotations.functions.LootTableKeyFunction;
import art.arcane.iris.spi.IrisPlatform;
import art.arcane.iris.engine.object.structure.vanilla.IrisNativeStructure;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.LogLevel;
import art.arcane.iris.spi.PlatformBiome;
@@ -127,7 +128,7 @@ public class SchemaBuilderParityTest {
if (previous != null) {
IrisPlatforms.unbind();
}
IrisPlatforms.bind(new FakePlatform());
IrisPlatforms.bind(new FakePlatform(null));
}
@After
@@ -231,6 +232,24 @@ public class SchemaBuilderParityTest {
assertFalse("the feature ids are not keys", properties.has("iris:decorant"));
}
/** A native structure's jigsaw start pool names one of the platform's template pools, and studio lists them. */
@Test
public void jigsawStartPoolsCompleteThePlatformsTemplatePools() {
PlatformStructureHooks hooks = mock(PlatformStructureHooks.class);
when(hooks.templatePoolKeys()).thenReturn(List.of("minecraft:village/plains/town_centers"));
IrisPlatforms.unbind();
IrisPlatforms.bind(new FakePlatform(hooks));
JSONObject schema = new SchemaBuilder(IrisNativeStructure.class, structureSchemaData()).construct();
JSONObject definitions = schema.getJSONObject("definitions");
JSONObject jigsaw = definitions.getJSONObject(definitionKey(schema.getJSONObject("properties").getJSONObject("jigsaw")))
.getJSONObject("properties");
assertEquals("enum-native-jigsaw-pool", definitionKey(jigsaw.getJSONObject("startPool")));
assertEquals(List.of("minecraft:village/plains/town_centers"),
values(definitions.getJSONObject("enum-native-jigsaw-pool").getJSONArray("enum")));
}
@Test
public void structureSettingsRenderTheirFitsWithTheModulesDefinitions() throws IOException {
JSONObject schema = new SchemaBuilder(IrisDimension.class, structureSchemaData(structureSettingsSchema())).construct();
@@ -670,6 +689,11 @@ public class SchemaBuilderParityTest {
private static final class FakePlatform implements IrisPlatform {
private final PlatformRegistries registries = new FakeRegistries();
private final PlatformStructureHooks structureHooks;
private FakePlatform(PlatformStructureHooks structureHooks) {
this.structureHooks = structureHooks;
}
@Override
public String platformName() {
@@ -693,7 +717,7 @@ public class SchemaBuilderParityTest {
@Override
public PlatformStructureHooks structureHooks() {
return null;
return structureHooks;
}
@Override