[Fix] Do not implicitly add keys to Biome registry (#16)
This commit is contained in:
parent
de94a808d0
commit
3b0f609776
2 changed files with 6 additions and 4 deletions
|
@ -511,12 +511,12 @@ public class BiomeAPI {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Holder<Biome> getFromBuiltinRegistry(ResourceLocation biomeID) {
|
public static Holder<Biome> getFromBuiltinRegistry(ResourceLocation biomeID) {
|
||||||
return BuiltinRegistries.BIOME.getHolder(ResourceKey.create(Registry.BIOME_REGISTRY, biomeID)).orElseThrow();
|
return BuiltinRegistries.BIOME.getHolder(ResourceKey.create(Registry.BIOME_REGISTRY, biomeID)).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Holder<Biome> getFromBuiltinRegistry(ResourceKey<Biome> key) {
|
public static Holder<Biome> getFromBuiltinRegistry(ResourceKey<Biome> key) {
|
||||||
return BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(key);
|
return BuiltinRegistries.BIOME.getHolder(key).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(forRemoval = true)
|
@Deprecated(forRemoval = true)
|
||||||
|
|
|
@ -177,9 +177,11 @@ public class InternalBiomeAPI {
|
||||||
.map(e -> e.getKey());
|
.map(e -> e.getKey());
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
s.forEach(id -> {
|
s.forEach(id -> {
|
||||||
Holder<Biome> biomeHolder = BiomeAPI.getBiomeHolder(id);
|
Holder<Biome> biomeHolder = BiomeAPI.getFromRegistry(id);
|
||||||
if (biomeHolder.isBound()) {
|
if (biomeHolder != null && biomeHolder.isBound()) {
|
||||||
mod.getValue().forEach(c -> c.accept(id, biomeHolder));
|
mod.getValue().forEach(c -> c.accept(id, biomeHolder));
|
||||||
|
} else {
|
||||||
|
BCLib.LOGGER.info("No Holder for " + id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue