Cancel target event on vanished players. Fixes #1809 (#1829)

This commit is contained in:
Lax 2018-02-03 11:26:43 -08:00 committed by Ali 'SupaHam' M
parent e4a8222d48
commit 05400429db

View File

@ -198,4 +198,14 @@ public class EssentialsEntityListener implements Listener {
} }
} }
} }
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityTarget(EntityTargetEvent event) {
if (event.getTarget() instanceof Player) {
final User user = ess.getUser((Player) event.getTarget());
if (user.isVanished()) {
event.setCancelled(true);
}
}
}
} }