Forge biome modifier validation

- Pass the modded loader into the generation registry so biome modifier output stays out of validation
- Cover Forge modifiers on climate, attributes, effects and features against the canonical definition
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-29 06:16:57 -04:00
1 parent 3e4a2432bc
commit 7db46a8eb8
3 files changed
+109 -3

No files matched your search

@@ -61,7 +61,7 @@ public final class ModdedPlatform implements IrisPlatform {
this.loader = loader;
this.registries = new ModdedRegistries(
NativeModdedServer.registryAccess(ModdedEngineBootstrap::currentServer, ModdedRegistries::warnNotReady),
ModdedPlatform::generationRegistry);
() -> generationRegistry(loader));
this.scheduler = new ModdedScheduler();
this.structureHooks = new ModdedStructureHooks(ModdedEngineBootstrap::currentServer);
this.biomeWriter = new ModdedBiomeWriter(new NativeBiomeRegistry(ModdedEngineBootstrap::currentServer, "minecraft:plains"));
@@ -352,11 +352,11 @@ public final class ModdedPlatform implements IrisPlatform {
}
}
private static PlatformGenerationRegistry generationRegistry() {
private static PlatformGenerationRegistry generationRegistry(NativeModdedLoader loader) {
if (ModdedEngineBootstrap.currentServer() == null) {
throw new IllegalStateException("Minecraft server is not ready for generation registry capture.");
}
return new ModdedGenerationRegistry(NativeModdedServer.registryDefinitions(ModdedEngineBootstrap::currentServer),
return new ModdedGenerationRegistry(NativeModdedServer.registryDefinitions(ModdedEngineBootstrap::currentServer, loader),
"modded-generation-registry-v1");
}
@@ -12,6 +12,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.state.BlockState;
import org.junit.Rule;
import org.junit.Test;
@@ -91,6 +92,11 @@ public class ModdedPlatformPathsTest {
public boolean checkSpawnPosition(Mob mob, ServerLevelAccessor level, EntitySpawnReason reason) {
return false;
}
@Override
public Biome unmodifiedBiome(Biome biome) {
return biome;
}
});
}