Attempt to fix fake-players being invincible through superperms.

A Player entity that's not an actual player will always return false for permissions, making it invincible. isOnline() seems to be an adequate check to determine the difference between a real player and a fake.
This commit is contained in:
Psithief 2012-06-25 21:43:56 +08:00
parent 503f5a8e40
commit 9492b01d97
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class EntityListener extends ModifyworldListener {
if (edbe.getEntity() instanceof Player) {
player = (Player) edbe.getEntity();
if (edbe.getDamager() != null) { // Prevent from taking damage by entity
if (edbe.getDamager() != null && player.isOnline()) { // Prevent from taking damage by entity
if (_permissionDenied(player, "modifyworld.damage.take", edbe.getDamager())) {
cancelDamageEvent(player, event);
}