mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Fix #getDungeonMob() NPE
This commit is contained in:
parent
612fb6828e
commit
df48257ef5
@ -707,6 +707,9 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
|
|||||||
@Override
|
@Override
|
||||||
public DungeonMob getDungeonMob(LivingEntity entity) {
|
public DungeonMob getDungeonMob(LivingEntity entity) {
|
||||||
GameWorld gameWorld = getGameWorld(entity.getWorld());
|
GameWorld gameWorld = getGameWorld(entity.getWorld());
|
||||||
|
if (gameWorld == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (DungeonMob mob : gameWorld.getMobs()) {
|
for (DungeonMob mob : gameWorld.getMobs()) {
|
||||||
if (mob.getEntity() == entity) {
|
if (mob.getEntity() == entity) {
|
||||||
return mob;
|
return mob;
|
||||||
|
Loading…
Reference in New Issue
Block a user