Semantic registry validation

- Generated registry validation always re-renders recorded semantics with the current fixer
- Validation canonicalizes the rendering like the installer
- Renderer changes need no version bump
- The renderer identity SPI, both identity strings and the identity-based source preference are gone
- New captures record the fixer class as an informational renderer identity
- The v1 history format is unchanged
- The modded forced datapack, world check and datapack command use the runtime data version
- That is the same data version validation uses
- Tests cover a renderer change under an unchanged identity
- Tests cover 26.3 bare natural_mob_spawns history against the overlay rendering
- Tests cover semantic round trips for every supported fixer
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-29 05:41:18 -04:00
1 parent aa428c0383
commit 3e4a2432bc
16 files changed
+409 -207

No files matched your search

@@ -20,6 +20,7 @@ package art.arcane.iris.modded;
import art.arcane.volmlib.util.collection.KSet;
import art.arcane.volmlib.util.json.JSONObject;
import art.arcane.iris.pack.datapack.DataVersion;
import art.arcane.iris.pack.datapack.v1217.DataFixerV1217;
import art.arcane.iris.world.history.GenerationEpochContractFactory;
import art.arcane.iris.world.history.GenerationRegistryContract;
@@ -27,6 +28,8 @@ import art.arcane.iris.world.history.GenerationRegistryContractFactory;
import art.arcane.iris.generation.biome.IrisCustomBiomeAliasResolver;
import art.arcane.iris.generation.terrain.IrisDimension;
import art.arcane.iris.generation.terrain.IrisDimensionType;
import art.arcane.iris.spi.IrisPlatform;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.PlatformGenerationRegistry;
import java.lang.reflect.Constructor;
import java.util.Set;
@@ -48,6 +51,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ModdedForcedDatapackTest {
@Test
@@ -65,6 +70,29 @@ public class ModdedForcedDatapackTest {
}
}
@Test
public void metadataFollowsTheRuntimeDataVersionThatValidationUses() throws IOException {
IrisPlatform previous = IrisPlatforms.getOrNull();
IrisPlatform runtime = mock(IrisPlatform.class);
when(runtime.minecraftVersion()).thenReturn("26.2");
Path packDirectory = Files.createTempDirectory("iris-modded-runtime-pack-format");
IrisPlatforms.unbind();
IrisPlatforms.bind(runtime);
try {
ModdedForcedDatapack.writePackMeta(packDirectory);
JSONObject pack = new JSONObject(Files.readString(packDirectory.resolve("pack.mcmeta")))
.getJSONObject("pack");
assertEquals(DataVersion.getRuntime().getPackFormat(), pack.getInt("pack_format"));
assertEquals(DataVersion.V26_2.getPackFormat(), pack.getInt("pack_format"));
} finally {
IrisPlatforms.unbind();
if (previous != null) {
IrisPlatforms.bind(previous);
}
deleteTree(packDirectory);
}
}
@Test
public void retainedDimensionSourceRendersBeforeNativeRegistryExists() throws Exception {
DataFixerV1217 fixer = new DataFixerV1217();