From f2889b7fd4fd7c10494dd8e893715b5aa5b6ebf9 Mon Sep 17 00:00:00 2001 From: Simplicitee Date: Thu, 16 Feb 2017 22:10:03 -0500 Subject: [PATCH] Reload changes (#731) --- .../projectkorra/projectkorra/GeneralMethods.java | 12 ++++++++++-- .../projectkorra/ability/CoreAbility.java | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/GeneralMethods.java b/src/com/projectkorra/projectkorra/GeneralMethods.java index ed038f08..f69852c7 100644 --- a/src/com/projectkorra/projectkorra/GeneralMethods.java +++ b/src/com/projectkorra/projectkorra/GeneralMethods.java @@ -90,9 +90,12 @@ import com.projectkorra.projectkorra.ability.EarthAbility; import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.WaterAbility; +import com.projectkorra.projectkorra.ability.util.CollisionInitializer; +import com.projectkorra.projectkorra.ability.util.CollisionManager; import com.projectkorra.projectkorra.ability.util.ComboManager; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.ability.util.MultiAbilityManager; +import com.projectkorra.projectkorra.ability.util.PassiveManager; import com.projectkorra.projectkorra.airbending.AirBlast; import com.projectkorra.projectkorra.airbending.AirShield; import com.projectkorra.projectkorra.airbending.AirSpout; @@ -1533,9 +1536,13 @@ public class GeneralMethods { ConfigManager.languageConfig.reload(); ConfigManager.presetConfig.reload(); Preset.loadExternalPresets(); - CoreAbility.registerAbilities(); - new ComboManager(); new MultiAbilityManager(); + new ComboManager(); + ProjectKorra.collisionManager = new CollisionManager(); + ProjectKorra.collisionInitializer = new CollisionInitializer(ProjectKorra.collisionManager); + CoreAbility.registerAbilities(); + ProjectKorra.collisionInitializer.initializeDefaultCollisions(); // must be called after abilities have been registered + ProjectKorra.collisionManager.startCollisionDetection(); DBConnection.host = ConfigManager.defaultConfig.get().getString("Storage.MySQL.host"); DBConnection.port = ConfigManager.defaultConfig.get().getInt("Storage.MySQL.port"); @@ -1551,6 +1558,7 @@ public class GeneralMethods { for (Player player : Bukkit.getOnlinePlayers()) { Preset.unloadPreset(player); GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName()); + PassiveManager.registerPassives(player); } plugin.updater.checkUpdate(); ProjectKorra.log.info("Reload complete"); diff --git a/src/com/projectkorra/projectkorra/ability/CoreAbility.java b/src/com/projectkorra/projectkorra/ability/CoreAbility.java index c934afb2..75c68d7a 100644 --- a/src/com/projectkorra/projectkorra/ability/CoreAbility.java +++ b/src/com/projectkorra/projectkorra/ability/CoreAbility.java @@ -404,6 +404,7 @@ public abstract class CoreAbility implements Ability { */ public static void registerAbilities() { ABILITIES_BY_NAME.clear(); + ABILITIES_BY_CLASS.clear(); registerPluginAbilities(ProjectKorra.plugin, "com.projectkorra"); registerAddonAbilities("/Abilities/"); }