[Fix] Crash due to outdated Biome reference
This commit is contained in:
parent
9c46a0874c
commit
82dba8391e
1 changed files with 4 additions and 3 deletions
|
@ -537,9 +537,10 @@ public class BiomeAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Holder<Biome> getFromRegistry(ResourceLocation biomeID) {
|
public static Holder<Biome> getFromRegistry(ResourceLocation biomeID) {
|
||||||
if (InternalBiomeAPI.biomeRegistry != null)
|
if (InternalBiomeAPI.biomeRegistry != null) {
|
||||||
return InternalBiomeAPI.biomeRegistry.getHolder(ResourceKey.create(Registries.BIOME, biomeID))
|
var holder = InternalBiomeAPI.biomeRegistry.getHolder(ResourceKey.create(Registries.BIOME, biomeID));
|
||||||
.orElseThrow();
|
if (holder.isPresent()) return holder.get();
|
||||||
|
}
|
||||||
|
|
||||||
if (WorldBootstrap.getLastRegistryAccess() != null) {
|
if (WorldBootstrap.getLastRegistryAccess() != null) {
|
||||||
var reg = WorldBootstrap.getLastRegistryAccess().registryOrThrow(Registries.BIOME);
|
var reg = WorldBootstrap.getLastRegistryAccess().registryOrThrow(Registries.BIOME);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue