public void onEntityDamage(EntityDamageEvent event)
{
if (!event.isCancelled())
{
Entity e = event.getEntity();
EpicZone sancZone = General.GetZoneForPlayer(null, e.getLocation().getWorld().getName(), e.getLocation().getBlockY(), new Point(e.getLocation().getBlockX(), e.getLocation().getBlockZ()));
if ((sancZone != null && !sancZone.getSanctuary()) || sancZone == null)
{
if (event.getCause() == DamageCause.ENTITY_ATTACK)
{
if (event instanceof EntityDamageByEntityEvent)
{
EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent) event;
if (isPlayer(sub.getEntity()) && isPlayer(sub.getDamager()))
{
Player player = (Player) sub.getEntity();
EpicZonePlayer ezp = General.getPlayer(player.getName());
EpicZone zone = ezp.getCurrentZone();
if (zone != null)
{
if (!zone.getPVP())
{
event.setCancelled(true);
}
}
else