mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 08:36:45 +01:00
parent
2e74333eb7
commit
a2cac82cba
@ -174,6 +174,10 @@ public class EntityListener implements Listener {
|
||||
Player defendingPlayer = (Player) defender;
|
||||
Player attackingPlayer = (Player) attacker;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(defendingPlayer) || !UserManager.hasPlayerDataKey(attackingPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We want to make sure we're not gaining XP or applying abilities when we hit ourselves
|
||||
if (defendingPlayer.equals(attackingPlayer)) {
|
||||
return;
|
||||
@ -226,6 +230,11 @@ public class EntityListener implements Listener {
|
||||
|
||||
if (livingEntity instanceof Player) {
|
||||
Player player = (Player) entity;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
/* Check for invincibility */
|
||||
|
Loading…
Reference in New Issue
Block a user