Patching more NPEs involving invbalid players, plus mob health bars.

This commit is contained in:
Glitchfinder 2013-05-13 18:39:16 -07:00
parent ed5a43966d
commit 7550b99aaa
2 changed files with 8 additions and 1 deletions

View File

@ -427,6 +427,10 @@ public class PlayerListener implements Listener {
ItemStack heldItem = player.getItemInHand(); ItemStack heldItem = player.getItemInHand();
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
if (mcMMOPlayer == null) {
return;
}
switch (event.getAction()) { switch (event.getAction()) {
case RIGHT_CLICK_BLOCK: case RIGHT_CLICK_BLOCK:
Block block = event.getClickedBlock(); Block block = event.getClickedBlock();

View File

@ -46,7 +46,10 @@ public final class MobHealthbarUtils {
PlayerProfile profile = UserManager.getPlayer(player).getProfile(); PlayerProfile profile = UserManager.getPlayer(player).getProfile();
if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) { if (profile == null) {
return;
}
else if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) {
return; return;
} }