From 95558371df589649b347e8e46d9cf07a35988332 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 9 Oct 2023 06:16:25 -0400 Subject: [PATCH] Method inlined --- src/engine/InterestManagement/Terrain.java | 4 ++-- src/engine/gameManager/ZoneManager.java | 6 +----- src/engine/mobileAI/MobAI.java | 2 +- src/engine/net/client/msg/WorldDataMsg.java | 2 +- src/engine/objects/Mob.java | 2 +- src/engine/objects/Zone.java | 4 ++-- src/engine/powers/poweractions/CreateMobPowerAction.java | 2 +- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 9fed2cd9..e2e5f38e 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -63,12 +63,12 @@ public class Terrain { Zone terrain_zone = zone; if (zone == null) - return ZoneManager.getSeaFloor(); + return ZoneManager.seaFloor; if (zone.terrain != null) return zone; - if (zone.equals(ZoneManager.getSeaFloor())) + if (zone.equals(ZoneManager.seaFloor)) return zone; while (terrain_zone.terrain == null) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 32f463fc..cf1594d2 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -51,7 +51,7 @@ public enum ZoneManager { public static int hotZoneCycle = 0; // Used with HOTZONE_DURATION from config. /* Instance variables */ - private static Zone seaFloor = null; + public static Zone seaFloor = null; // Find all zones coordinates fit into, starting with Sea Floor @@ -175,10 +175,6 @@ public enum ZoneManager { return (Bounds.collide(loc, ZoneManager.hotZone.bounds)); } - public static Zone getSeaFloor() { - return ZoneManager.seaFloor; - } - public static void setSeaFloor(final Zone value) { ZoneManager.seaFloor = value; } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 10696af9..38864cac 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -991,7 +991,7 @@ public class MobAI { try { if (mob.guardCaptain == null && mob.isNecroPet() == false && mob.isSiege() == false) - if (ZoneManager.getSeaFloor().zoneMobSet.contains(mob)) + if (ZoneManager.seaFloor.zoneMobSet.contains(mob)) mob.killCharacter("no owner"); if (MovementUtilities.canMove(mob) && mob.behaviourType.canRoam) diff --git a/src/engine/net/client/msg/WorldDataMsg.java b/src/engine/net/client/msg/WorldDataMsg.java index 2db0ee11..d18178e7 100644 --- a/src/engine/net/client/msg/WorldDataMsg.java +++ b/src/engine/net/client/msg/WorldDataMsg.java @@ -73,7 +73,7 @@ public class WorldDataMsg extends ClientNetMsg { // TODO replace this return with SerializationException - Zone root = ZoneManager.getSeaFloor(); + Zone root = ZoneManager.seaFloor; if (root == null) { Logger.error("Failed to find Sea Floor!"); return; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 532a6aeb..222485d5 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -897,7 +897,7 @@ public class Mob extends AbstractIntelligenceAgent { this.setCombatTarget(null); this.hasLoot = false; - ZoneManager.getSeaFloor().zoneMobSet.remove(this); + ZoneManager.seaFloor.zoneMobSet.remove(this); try { this.clearEffects(); diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 76ac747c..ee1db826 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -310,7 +310,7 @@ public class Zone extends AbstractGameObject { public boolean isContinent() { - if (this.equals(ZoneManager.getSeaFloor())) + if (this.equals(ZoneManager.seaFloor)) return false; if (this.getNodes().isEmpty()) @@ -319,7 +319,7 @@ public class Zone extends AbstractGameObject { if (this.getNodes().get(0).isMacroZone()) return true; - return this.parent.equals(ZoneManager.getSeaFloor()); + return this.parent.equals(ZoneManager.seaFloor); } public void setHash() { diff --git a/src/engine/powers/poweractions/CreateMobPowerAction.java b/src/engine/powers/poweractions/CreateMobPowerAction.java index 41c7e810..a0ec17e9 100644 --- a/src/engine/powers/poweractions/CreateMobPowerAction.java +++ b/src/engine/powers/poweractions/CreateMobPowerAction.java @@ -56,7 +56,7 @@ public class CreateMobPowerAction extends AbstractPowerAction { PlayerCharacter owner = (PlayerCharacter) source; Mob currentPet = owner.getPet(); - Zone seaFloor = ZoneManager.getSeaFloor(); + Zone seaFloor = ZoneManager.seaFloor; Guild guild = Guild.getErrantGuild(); ClientConnection origin = owner.getClientConnection();