mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Patching more NPEs involving invbalid players, plus mob health bars.
This commit is contained in:
parent
ed5a43966d
commit
7550b99aaa
@ -427,6 +427,10 @@ public class PlayerListener implements Listener {
|
||||
ItemStack heldItem = player.getItemInHand();
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.getAction()) {
|
||||
case RIGHT_CLICK_BLOCK:
|
||||
Block block = event.getClickedBlock();
|
||||
|
@ -46,7 +46,10 @@ public final class MobHealthbarUtils {
|
||||
|
||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
||||
|
||||
if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) {
|
||||
if (profile == null) {
|
||||
return;
|
||||
}
|
||||
else if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user