mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
I'd say no
But if the player can actually be off-line, be sure to add a comment explaining why.
This commit is contained in:
parent
79a5732c4d
commit
d3ec976f44
@ -103,17 +103,11 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (defender instanceof Player) {
|
||||
if (defender instanceof Player && attacker instanceof Player) {
|
||||
Player defendingPlayer = (Player) defender;
|
||||
|
||||
// TODO: Is this even possible?
|
||||
if (!defendingPlayer.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (attacker instanceof Player) {
|
||||
Player attackingPlayer = (Player) attacker;
|
||||
|
||||
// TODO: Why?
|
||||
if (defendingPlayer == attackingPlayer) {
|
||||
return;
|
||||
}
|
||||
@ -124,7 +118,6 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for invincibility */
|
||||
if (defender instanceof LivingEntity) {
|
||||
@ -163,8 +156,7 @@ public class EntityListener implements Listener {
|
||||
if (livingEntity instanceof Player) {
|
||||
Player player = (Player) entity;
|
||||
|
||||
// TODO: Is it even possible for the player to be off-line here?
|
||||
if (!player.isOnline() || Misc.isNPCEntity(player)) {
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user