Browse Source

Revert method refactor.

master
MagicBot 2 years ago
parent
commit
1c228df4a8
  1. 4
      src/engine/net/client/msg/guild/GuildInfoMsg.java
  2. 20
      src/engine/objects/Guild.java

4
src/engine/net/client/msg/guild/GuildInfoMsg.java

@ -373,7 +373,7 @@ class GuildInfoMessageType5 extends GuildInfoMessageType { @@ -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 { @@ -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");

20
src/engine/objects/Guild.java

@ -81,6 +81,9 @@ public class Guild extends AbstractWorldObject { @@ -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<Integer,GuildAlliances> guildAlliances = new HashMap<>();
@ -407,7 +410,7 @@ public class Guild extends AbstractWorldObject { @@ -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); @@ -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) {

Loading…
Cancel
Save