From 1c228df4a85c951fdd078ca71f7ad2e6bde23f1d Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 20 Jan 2023 11:24:37 -0500 Subject: [PATCH] Revert method refactor. --- .../net/client/msg/guild/GuildInfoMsg.java | 4 ++-- src/engine/objects/Guild.java | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/engine/net/client/msg/guild/GuildInfoMsg.java b/src/engine/net/client/msg/guild/GuildInfoMsg.java index 92e48dcc..f81f4f06 100644 --- a/src/engine/net/client/msg/guild/GuildInfoMsg.java +++ b/src/engine/net/client/msg/guild/GuildInfoMsg.java @@ -373,7 +373,7 @@ class GuildInfoMessageType5 extends GuildInfoMessageType { if(pc != null && g != null && g.getObjectUUID() != 0) { Guild n = g.getNation(); if(n == null) { - n = Guild.getErrantGuild(); + n = Guild.getErrantNation(); } writer.putInt(ago.getObjectType().ordinal()); @@ -412,7 +412,7 @@ class GuildInfoMessageType5 extends GuildInfoMessageType { writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title writer.putInt(g.getCharter()); - if(g.getNation().equals(Guild.getErrantGuild())) + if(g.getNation().equals(Guild.getErrantNation())) writer.putString("Errant"); else writer.putString("City"); diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index bfc98f76..c87bbc9c 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -81,6 +81,9 @@ public class Guild extends AbstractWorldObject { private String hash; private boolean ownerIsNPC; + private static Guild errantGuild; + private static Guild errantNation; + public LocalDateTime lastWooEditTime; public HashMap guildAlliances = new HashMap<>(); @@ -407,7 +410,7 @@ public class Guild extends AbstractWorldObject { */ public boolean isErrant() { - return this.getObjectUUID() == Guild.errant.getObjectUUID(); + return this.getObjectUUID() == Guild.errantGuild.getObjectUUID(); } @@ -721,14 +724,19 @@ Guild.serializeForClientMsg(guild,writer, null, false); } - private static Guild errant; - public static Guild getErrantGuild() { - if (Guild.errant == null) - Guild.errant = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0); + if (Guild.errantGuild == null) + Guild.errantGuild = new Guild( "None", Guild.getErrantNation(), 0, + "Anarchy", GuildTag.ERRANT, 0); + + return Guild.errantGuild; + } - return Guild.errant; + public static Guild getErrantNation() { + if (Guild.errantNation == null) + Guild.errantNation = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0); + return Guild.errantNation; } public static Guild getGuild(final int objectUUID) {