Check entityID whether is negative or not. (#1362)

This commit is contained in:
Rothes 2021-09-22 22:51:47 +08:00 committed by GitHub
parent 5dda8c8ab1
commit dbedab0c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -717,7 +717,7 @@ public class BukkitConverters {
ProtocolManager manager = managerRef.get();
// Use the entity ID to get a reference to the entity
if (id != null && manager != null) {
if (id != null && id >= 0 && manager != null) {
return manager.getEntityFromID(world, id);
} else {
return null;