Fixed NullPointerException when breaking/placing a spawner (#380)

* fix: Make Util#getEntityId parameter nullable

* Removed JetBrains Nullable

* Updated to follow contribution guidelines

---------

Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com>
This commit is contained in:
ByteExceptionM 2023-06-14 01:14:09 +02:00 committed by GitHub
parent d64ec8d911
commit 814ae4d9d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -859,6 +859,10 @@ public class Util extends Queue {
} }
public static int getEntityId(EntityType type) { public static int getEntityId(EntityType type) {
if (type == null) {
return -1;
}
return getEntityId(type.name(), true); return getEntityId(type.name(), true);
} }