1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-20 07:01:22 +01:00

Correct way in checking if entity alive

This commit is contained in:
Zrips 2018-10-14 12:59:39 +03:00
parent ac31db0927
commit fe9d6960c7

View File

@ -589,14 +589,11 @@ public class ItemManager {
}
public boolean isAlive() {
if (version.isLower(Version.v1_9_R1))
return true; // TODO: Fixing NullPointerException
return getType().isAlive();
return getType() == null ? false : getType().isAlive();
}
public boolean isSpawnable() {
return getType().isSpawnable();
return getType() == null ? false : getType().isSpawnable();
}
public static String getRealNameByType(EntityType type) {