Skip biomes that are missing in registry (#145)
This commit is contained in:
parent
dc3f90aeec
commit
e0890d6e25
2 changed files with 13 additions and 4 deletions
|
@ -11,7 +11,7 @@ loader_version= 0.13.3
|
||||||
fabric_version = 0.48.0+1.18.2
|
fabric_version = 0.48.0+1.18.2
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.6
|
mod_version = 1.5.0
|
||||||
maven_group = ru.bclib
|
maven_group = ru.bclib
|
||||||
archives_base_name = bclib
|
archives_base_name = bclib
|
||||||
|
|
||||||
|
|
|
@ -430,19 +430,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.getOrCreateHolder(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