mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 11:38:03 +01:00
Registries#getEntityType should return null if invalid
This commit is contained in:
parent
ef1afb9cd9
commit
2c2a691af7
@ -1,7 +1,6 @@
|
||||
// AUTOGENERATED by net.minestom.codegen.RegistriesGenerator
|
||||
package net.minestom.server.registry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import net.minestom.server.entity.EntityType;
|
||||
import net.minestom.server.fluids.Fluid;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
@ -16,6 +15,8 @@ import net.minestom.server.utils.NamespaceID;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* AUTOGENERATED
|
||||
*/
|
||||
@ -129,19 +130,19 @@ public final class Registries {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the corresponding EntityType matching the given id. Returns 'PIG' if none match.
|
||||
* Returns the corresponding EntityType matching the given id. Returns null if none match.
|
||||
*/
|
||||
@NotNull
|
||||
@Nullable
|
||||
public static EntityType getEntityType(String id) {
|
||||
return getEntityType(NamespaceID.from(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the corresponding EntityType matching the given id. Returns 'PIG' if none match.
|
||||
* Returns the corresponding EntityType matching the given id. Returns null if none match.
|
||||
*/
|
||||
@NotNull
|
||||
@Nullable
|
||||
public static EntityType getEntityType(NamespaceID id) {
|
||||
return entityTypes.getOrDefault(id, EntityType.PIG);
|
||||
return entityTypes.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user