Fix #getDungeonMob() NPE

This commit is contained in:
Daniel Saukel 2020-05-02 00:45:58 +02:00
parent 612fb6828e
commit df48257ef5
1 changed files with 3 additions and 0 deletions

View File

@ -707,6 +707,9 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
@Override
public DungeonMob getDungeonMob(LivingEntity entity) {
GameWorld gameWorld = getGameWorld(entity.getWorld());
if (gameWorld == null) {
return null;
}
for (DungeonMob mob : gameWorld.getMobs()) {
if (mob.getEntity() == entity) {
return mob;