From d985792cae16856ee16123748025f015c86f0d08 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 27 May 2022 17:09:36 +0200 Subject: [PATCH] Skip biomes that are missing in registry (paulevsGitch/BCLib#145) --- .../org/betterx/bclib/api/biomes/BiomeAPI.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/betterx/bclib/api/biomes/BiomeAPI.java b/src/main/java/org/betterx/bclib/api/biomes/BiomeAPI.java index 2ef82798..1d58cc41 100644 --- a/src/main/java/org/betterx/bclib/api/biomes/BiomeAPI.java +++ b/src/main/java/org/betterx/bclib/api/biomes/BiomeAPI.java @@ -525,19 +525,28 @@ public class BiomeAPI { public static void loadFabricAPIBiomes() { FabricBiomesData.NETHER_BIOMES.forEach((key) -> { if (!hasBiome(key.location())) { - registerNetherBiome(BuiltinRegistries.BIOME.get(key)); + Optional> optional = BuiltinRegistries.BIOME.getHolder(key); + if (optional.isPresent()) { + registerNetherBiome(optional.get().value()); + } } }); FabricBiomesData.END_LAND_BIOMES.forEach((key, weight) -> { if (!hasBiome(key.location())) { - registerEndLandBiome(BuiltinRegistries.BIOME.getHolder(key).orElseThrow(), weight); + Optional> optional = BuiltinRegistries.BIOME.getHolder(key); + if (optional.isPresent()) { + registerEndLandBiome(optional.get(), weight); + } } }); FabricBiomesData.END_VOID_BIOMES.forEach((key, weight) -> { if (!hasBiome(key.location())) { - registerEndVoidBiome(BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(key), weight); + Optional> optional = BuiltinRegistries.BIOME.getHolder(key); + if (optional.isPresent()) { + registerEndVoidBiome(optional.get(), weight); + } } }); }