}
@Override
public void onCustomEvent(Event event) {
if (event.getEventName().equals("CellAttack")) {
CellAttackEvent cellAttackEvent = (CellAttackEvent)event;
try {
CellUnderAttack cell = cellAttackEvent.getData();
TownyWar.registerAttack(cell);
} catch (Exception e) {
cellAttackEvent.setCancelled(true);
cellAttackEvent.setReason(e.getMessage());
}
} else if (event.getEventName().equals("CellDefended")) {
CellDefendedEvent cellDefendedEvent = (CellDefendedEvent)event;
Player player = cellDefendedEvent.getPlayer();
CellUnderAttack cell = cellDefendedEvent.getCell().getAttackData();