update platform biome delegate logic

This commit is contained in:
dfsek authored and Astrash committed 2023-02-06 19:18:08 +11:00
1 parent 4e4627d11d
commit 0006762ff3
5 files changed
+12 -24

No files matched your search

@@ -54,7 +54,7 @@ public final class BiomeUtil {
if(pack.getContext().get(PreLoadCompatibilityOptions.class).useVanillaBiomes()) {
((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(vanilla);
((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(registry.getEntry(vanilla).orElseThrow());
} else {
VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class);
@@ -65,14 +65,12 @@ public final class BiomeUtil {
if(registry.containsId(identifier)) {
((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(MinecraftUtil.getEntry(registry, identifier)
.orElseThrow()
.getKey()
.orElseThrow());
} else {
((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(Registry.registerReference(registry,
MinecraftUtil.registerKey(identifier)
.getValue(),
minecraftBiome).getKey().orElseThrow());
minecraftBiome));
}
Map<RegistryKey<net.minecraft.world.biome.Biome>, VillagerType> villagerMap = VillagerTypeAccessor.getBiomeTypeToIdMap();