Skip biomes that are missing in registry (paulevsGitch/BCLib#145)
This commit is contained in:
parent
50fe9c2342
commit
d985792cae
1 changed files with 12 additions and 3 deletions
|
@ -525,19 +525,28 @@ public class BiomeAPI {
|
||||||
public static void loadFabricAPIBiomes() {
|
public static void loadFabricAPIBiomes() {
|
||||||
FabricBiomesData.NETHER_BIOMES.forEach((key) -> {
|
FabricBiomesData.NETHER_BIOMES.forEach((key) -> {
|
||||||
if (!hasBiome(key.location())) {
|
if (!hasBiome(key.location())) {
|
||||||
registerNetherBiome(BuiltinRegistries.BIOME.get(key));
|
Optional<Holder<Biome>> optional = BuiltinRegistries.BIOME.getHolder(key);
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
registerNetherBiome(optional.get().value());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
FabricBiomesData.END_LAND_BIOMES.forEach((key, weight) -> {
|
FabricBiomesData.END_LAND_BIOMES.forEach((key, weight) -> {
|
||||||
if (!hasBiome(key.location())) {
|
if (!hasBiome(key.location())) {
|
||||||
registerEndLandBiome(BuiltinRegistries.BIOME.getHolder(key).orElseThrow(), weight);
|
Optional<Holder<Biome>> optional = BuiltinRegistries.BIOME.getHolder(key);
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
registerEndLandBiome(optional.get(), weight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
FabricBiomesData.END_VOID_BIOMES.forEach((key, weight) -> {
|
FabricBiomesData.END_VOID_BIOMES.forEach((key, weight) -> {
|
||||||
if (!hasBiome(key.location())) {
|
if (!hasBiome(key.location())) {
|
||||||
registerEndVoidBiome(BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(key), weight);
|
Optional<Holder<Biome>> optional = BuiltinRegistries.BIOME.getHolder(key);
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
registerEndVoidBiome(optional.get(), weight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue