}
}
private void monarchDeath(Player attackerPlayer, Player defenderPlayer, Resident attackerResident, Resident defenderResident) {
if (plugin.getTownyUniverse().isWarTime()) {
War warEvent = plugin.getTownyUniverse().getWarEvent();
try {
Nation defenderNation = defenderResident.getTown().getNation();
if (warEvent.isWarringNation(defenderNation))
if (defenderResident.isMayor())
if (defenderResident.isKing()) {
if (attackerResident != null && attackerResident.hasTown())
warEvent.remove(attackerResident.getTown(), defenderNation);
else
warEvent.remove(defenderNation);
TownyMessaging.sendGlobalMessage(defenderNation.getName() + "'s king was killed. Nation removed from war.");
} else {
if (attackerResident != null && attackerResident.hasTown())
warEvent.remove(attackerResident.getTown(), defenderResident.getTown());
else
warEvent.remove(defenderResident.getTown());
TownyMessaging.sendGlobalMessage(defenderResident.getTown() + "'s mayor was killed. Town removed from war.");
}
} catch (NotRegisteredException e) {
}
}