Fixes minor bug in the biome implementation. (#1999)

The registry method was never implemented correctly and always returns a null reference. This commit solves the problem and will return an object in some cases in the future.
This commit is contained in:
Phillipp Glanz 2024-02-17 15:24:08 +01:00 committed by GitHub
parent fe46ed4ac2
commit ffb33e608d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,7 @@ final class BiomeImpl implements ProtocolObject, Biome {
return CONTAINER.getSafe(namespace);
}
private Registry.BiomeEntry entry;
@NotNull
private final NamespaceID name;
private final float depth;
@ -52,6 +53,7 @@ final class BiomeImpl implements ProtocolObject, Biome {
}
BiomeImpl(Registry.BiomeEntry entry) {
this.entry = entry;
this.name = entry.namespace();
this.depth = 0.2f;
this.scale = 0.2f;
@ -85,7 +87,7 @@ final class BiomeImpl implements ProtocolObject, Biome {
@Nullable
@Override
public Registry.BiomeEntry registry() {
return null;
return this.entry;
}
@Override