diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 99dd790ca..630396691 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -128,6 +128,10 @@ public class PlayerListener implements Listener { McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + if (mcMMOPlayer == null) { + return; + } + if (mcMMOPlayer.getGodMode() && !Permissions.mcgod(player)) { mcMMOPlayer.toggleGodMode(); player.sendMessage(LocaleLoader.getString("Commands.GodMode.Forbidden")); diff --git a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java index 3865896a1..3a79b05a8 100644 --- a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java @@ -29,5 +29,4 @@ public class MctopCommandAsyncTask extends BukkitRunnable { new MctopCommandDisplayTask(userslist, page, tablePrefix, sender).runTaskLater(mcMMO.p, 1); } - } diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 4efee054d..a17ad15c7 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -266,7 +266,7 @@ public final class CombatUtils { if (target instanceof Player) { Player player = (Player) target; - if (Misc.isNPCEntity(player)) { + if (Misc.isNPCEntity(player) || !player.isOnline()) { return; } @@ -291,6 +291,11 @@ public final class CombatUtils { } else if (attacker instanceof Player) { Player player = (Player) attacker; + + if (Misc.isNPCEntity(player)) { + return; + } + PlayerProfile profile = UserManager.getPlayer(player).getProfile(); if (Permissions.mobHealthDisplay(player) && profile.getMobHealthbarType() != MobHealthbarType.DISABLED) {