Some additional logging

This commit is contained in:
Zoë Gidiere 2025-06-03 15:15:07 -06:00
parent f14d22b264
commit c4f093210a

View File

@ -51,13 +51,35 @@ public final class LifecycleBiomeUtil {
Registry<net.minecraft.world.biome.Biome> registry) {
RegistryKey<net.minecraft.world.biome.Biome> vanilla = ((ProtoPlatformBiome) biome.getPlatformBiome()).get(registry);
if (vanilla == null) {
logger.error("""
Failed to get Vanilla Biome Regiestry key!
Terra Biome ID: {}
Vanilla Biome: {}""", biome.getID(), biome.getPlatformBiome());
}
if(pack.getContext().get(PreLoadCompatibilityOptions.class).useVanillaBiomes()) {
((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(registry.getEntry(registry.get(vanilla)));
} else {
VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class);
net.minecraft.world.biome.Biome minecraftBiome = BiomeUtil.createBiome(Objects.requireNonNull(registry.get(vanilla)),
net.minecraft.world.biome.Biome vanilaBiome = registry.get(vanilla);
if (vanilaBiome == null) {
String vanillaBiomeName;
if (vanilla != null ) {
vanillaBiomeName = vanilla.getValue().toString();
} else {
vanillaBiomeName = "NULL";
}
logger.error("""
Failed to get Vanilla Biome!
Terra Biome ID: {}
Vanilla Biome: {}""", biome.getID(), vanillaBiomeName);
return;
}
net.minecraft.world.biome.Biome minecraftBiome = BiomeUtil.createBiome(Objects.requireNonNull(vanilaBiome),
vanillaBiomeProperties);
Identifier identifier = Identifier.of("terra", BiomeUtil.createBiomeID(pack, id));