[Fixed] Prevent crashes from null registry in Fog-Rendered (#69)
This commit is contained in:
parent
154e652991
commit
ecc5ea0eec
1 changed files with 9 additions and 6 deletions
|
@ -438,12 +438,15 @@ public class BiomeAPI {
|
|||
public static BCLBiome getRenderBiome(Biome biome) {
|
||||
BCLBiome endBiome = InternalBiomeAPI.CLIENT.get(biome);
|
||||
if (endBiome == null) {
|
||||
var reg = BCLBiomeRegistry.registryOrNull();
|
||||
ResourceLocation id = WorldBootstrap.getLastRegistryAccessOrElseBuiltin()
|
||||
.registryOrThrow(Registries.BIOME)
|
||||
.getKey(biome);
|
||||
endBiome = BCLBiomeRegistry.getBiomeOrEmpty(id, reg);
|
||||
InternalBiomeAPI.CLIENT.put(biome, endBiome);
|
||||
var acc = WorldBootstrap.getLastRegistryAccessOrElseBuiltin();
|
||||
if (acc != null) {
|
||||
final Registry<BCLBiome> reg = BCLBiomeRegistry.registryOrNull();
|
||||
ResourceLocation id = acc
|
||||
.registryOrThrow(Registries.BIOME)
|
||||
.getKey(biome);
|
||||
endBiome = BCLBiomeRegistry.getBiomeOrEmpty(id, reg);
|
||||
InternalBiomeAPI.CLIENT.put(biome, endBiome);
|
||||
}
|
||||
}
|
||||
return endBiome;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue