{
if (interactiveItems.contains((event.getPlayer().getItemInHand().getTypeId())))
{
Player player = event.getPlayer();
EpicZonePlayer ezp = General.getPlayer(player.getName());
Point blockPoint = new Point(event.getClickedBlock().getLocation().getBlockX(), event.getClickedBlock().getLocation().getBlockZ());
String worldName = player.getWorld().getName();
int blockHeight = event.getClickedBlock().getLocation().getBlockY();
boolean hasPerms;
EpicZone currentZone;
if (General.BorderLogic(blockPoint, player))
{
currentZone = General.GetZoneForPlayer(player, worldName, blockHeight, blockPoint);
hasPerms = ZonePermissionsHandler.hasPermissions(player, currentZone, "build");
if (!hasPerms)
{
if (ezp.getLastWarned().before(new Date()))
{
Message.Send(player, Message_ID.Warning_00036_Perm_GenericInZone);
ezp.Warn();
}
event.setCancelled(true);
}
}
}
else if (event.getPlayer().getItemInHand().getTypeId() == Config.zoneTool)
{
if (General.getPlayer(event.getPlayer().getName()).getMode() == EpicZoneMode.ZoneDraw)
{
Point point = new Point(event.getClickedBlock().getLocation().getBlockX(), event.getClickedBlock().getLocation().getBlockZ());
EpicZonePlayer ezp = General.getPlayer(event.getPlayer().getName());
ezp.getEditZone().addPoint(point);
ezp.getEditZone().addPillar(event.getClickedBlock());
ezp.getEditZone().ShowPillar(point);
Message.Send(event.getPlayer(), Message_ID.Info_00112_Point_XZ_Added, new String[]{Integer.toString(point.x), Integer.toString(point.y)});
}
}
}
}