From 931eaaae4a9b77cbd63e1b9c612b61da457c8409 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 31 Dec 2024 13:30:19 -0600 Subject: [PATCH] city bane status update fix --- src/engine/objects/City.java | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index e30a2afa..937942b8 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -237,18 +237,22 @@ public class City extends AbstractWorldObject { writer.putInt(rulingGuild.getObjectUUID()); writer.putString(rulingGuild.getName()); - if(city.getBane() != null) { - Bane bane = city.getBane(); - if(bane.daySet && bane.timeSet && bane.getLiveDate() != null){ - int day = bane.getLiveDate().dayOfMonth().get(); - int month = bane.getLiveDate().getMonthOfYear(); - int year = bane.getLiveDate().year().get(); - int hour = bane.getLiveDate().getHourOfDay(); - writer.putString("BANE SET: " + month + "/" + day + "/" + year + " " + hour + ":00 CST"); - }else { - writer.putString("BANED!: Unset"); + try { + if (city.getBane() != null) { + Bane bane = city.getBane(); + if (bane.daySet && bane.timeSet && bane.getLiveDate() != null) { + int day = bane.getLiveDate().dayOfMonth().get(); + int month = bane.getLiveDate().getMonthOfYear(); + int year = bane.getLiveDate().year().get(); + int hour = bane.getLiveDate().getHourOfDay(); + writer.putString("BANE SET: " + month + "/" + day + "/" + year + " " + hour + ":00 CST"); + } else { + writer.putString("BANED!: Unset"); + } + } else { + writer.putString(city.motto); } - }else{ + }catch(Exception e){ writer.putString(city.motto); } writer.putString(rulingGuild.getLeadershipType());