mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +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