Reload changes (#731)

This commit is contained in:
Simplicitee 2017-02-16 22:10:03 -05:00 committed by Christopher Martin
parent 2cb73c71ec
commit f2889b7fd4
2 changed files with 11 additions and 2 deletions

View file

@ -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");

View file

@ -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/");
}