diff --git a/src/main/java/org/betterx/bclib/api/v2/generator/BCLBiomeSource.java b/src/main/java/org/betterx/bclib/api/v2/generator/BCLBiomeSource.java index 291abdd9..862f03c1 100644 --- a/src/main/java/org/betterx/bclib/api/v2/generator/BCLBiomeSource.java +++ b/src/main/java/org/betterx/bclib/api/v2/generator/BCLBiomeSource.java @@ -238,24 +238,30 @@ public abstract class BCLBiomeSource extends BiomeSource implements BiomeSourceW final List excludeList = Configs.BIOMES_CONFIG.getExcludeMatching(defaultBiomeType()); final Registry bclBiomes = access.registryOrThrow(BCLBiomeRegistry.BCL_BIOMES_REGISTRY); - for (Holder possibleBiome : inputBiomeSource.possibleBiomes()) { - ResourceKey key = possibleBiome.unwrapKey().orElse(null); - if (key != null) { - //skip over all biomes that were excluded in the config - if (excludeList.contains(key.location())) continue; + try { + for (Holder possibleBiome : inputBiomeSource.possibleBiomes()) { + ResourceKey key = possibleBiome.unwrapKey().orElse(null); + if (key != null) { + //skip over all biomes that were excluded in the config + if (excludeList.contains(key.location())) continue; - //this is a biome that has no type entry => create a new one for the default type of this registry - if (!BCLBiomeRegistry.hasBiome(key, bclBiomes)) { - BiomeAPI.BiomeType type = typeForUnknownBiome(key, defaultBiomeType()); + //this is a biome that has no type entry => create a new one for the default type of this registry + if (!BCLBiomeRegistry.hasBiome(key, bclBiomes)) { + BiomeAPI.BiomeType type = typeForUnknownBiome(key, defaultBiomeType()); - //check if there was an override defined in the configs - type = getBiomeType(includeMap, key, type); + //check if there was an override defined in the configs + type = getBiomeType(includeMap, key, type); - //create and register a biome wrapper - BCLBiome bclBiome = new BCLBiome(key.location(), type); - BCLBiomeRegistry.register(bclBiome); + //create and register a biome wrapper + BCLBiome bclBiome = new BCLBiome(key.location(), type); + BCLBiomeRegistry.register(bclBiome); + } } } + } catch (RuntimeException e) { + BCLib.LOGGER.error("Error while rebuilding Biomesources!", e); + } catch (Exception e) { + BCLib.LOGGER.error("Error while rebuilding Biomesources!", e); } this.reloadBiomes(); diff --git a/src/main/java/org/betterx/worlds/together/biomesource/MergeableBiomeSource.java b/src/main/java/org/betterx/worlds/together/biomesource/MergeableBiomeSource.java index d742fb47..15cfe6d7 100644 --- a/src/main/java/org/betterx/worlds/together/biomesource/MergeableBiomeSource.java +++ b/src/main/java/org/betterx/worlds/together/biomesource/MergeableBiomeSource.java @@ -1,5 +1,7 @@ package org.betterx.worlds.together.biomesource; +import org.betterx.bclib.BCLib; + import net.minecraft.core.Holder; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.BiomeSource; @@ -9,12 +11,19 @@ import java.util.Set; public interface MergeableBiomeSource { default boolean togetherShouldMerge(BiomeSource inputBiomeSource) { Set> mySet = ((B) this).possibleBiomes(); - Set> otherSet = inputBiomeSource.possibleBiomes(); - if (otherSet.size() != mySet.size()) return true; + try { + Set> otherSet = inputBiomeSource.possibleBiomes(); - for (Holder b : mySet) { - if (!otherSet.contains(b)) - return true; + if (otherSet.size() != mySet.size()) return true; + + for (Holder b : mySet) { + if (!otherSet.contains(b)) + return true; + } + } catch (RuntimeException e) { + BCLib.LOGGER.error("Failed to merge BiomeSource", e); + } catch (Exception e) { + BCLib.LOGGER.error("Failed to merge BiomeSource", e); } return false;