diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 4dbca015..3542d61d 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -54,6 +54,7 @@ public enum PowersManager { public static HashMap modifiersByToken = new HashMap<>(); public static HashMap AnimationOverrides = new HashMap<>(); private static JobScheduler js; + public static HashMap> AllMobPowers; public static void initPowersManager(boolean fullPowersLoad) { @@ -2784,6 +2785,18 @@ SourceType sourceType = SourceType.GetSourceType(pb.getCategory()); } } } + public static void GatherMobPowers(){ + for(Mob mob : DbManager.MobQueries.GET_ALL_MOBS()){ + if(DbManager.MobBaseQueries.LOAD_STATIC_POWERS(mob.getMobBaseID()).isEmpty() == true){ + continue; + } + else { + HashMap mobPowers = DbManager.MobBaseQueries.LOAD_STATIC_POWERS(mob.getMobBaseID()); + AllMobPowers.put(mob.getMobBaseID(), mobPowers); + } + } + Logger.info("Static Mob Powers HashMap Loaded Successfully..."); + } } diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 79f009fc..3416489a 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -2220,7 +2220,7 @@ public class Mob extends AbstractIntelligenceAgent { Logger.error( e.getMessage()); } //mobPowers = DbManager.MobBaseQueries.LOAD_STATIC_POWERS(this.getMobBaseID()); - mobPowers = (HashMap) WorldServer.AllMobPowers.get(this.getMobBaseID()).entrySet(); + mobPowers = (HashMap) PowersManager.AllMobPowers.get(this.getMobBaseID()).entrySet(); if(this.isPlayerGuard() == true){ //load guards powers ArrayList mobbases = DbManager.MobBaseQueries.GET_ALL_MOBBASES(); diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 3c973aa0..6330b3b3 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -75,7 +75,6 @@ public class WorldServer { // Member variable declaration public static HashMap>> ZoneFidelityMobRunes = new HashMap<>(); - public static HashMap> AllMobPowers; public WorldServer() { super(); } @@ -471,21 +470,9 @@ public class WorldServer { System.gc(); Logger.info("Loading All Mob Powers..."); - GatherMobPowers(); + PowersManager.GatherMobPowers(); return true; } - private void GatherMobPowers(){ - for(Mob mob : DbManager.MobQueries.GET_ALL_MOBS()){ - if(DbManager.MobBaseQueries.LOAD_STATIC_POWERS(mob.getMobBaseID()).isEmpty() == true){ - continue; - } - else { - HashMap mobPowers = DbManager.MobBaseQueries.LOAD_STATIC_POWERS(mob.getMobBaseID()); - AllMobPowers.put(mob.getMobBaseID(), mobPowers); - } - } - Logger.info("Static Mob Powers HashMap Loaded Successfully..."); - } protected boolean initDatabaselayer() { // Try starting a GOM <-> DB connection.