use of com.magmaguy.elitemobs.config.ConfigValues in project EliteMobs by MagmaGuy.
the class EliteMobs method reloadConfiguration.
public void reloadConfiguration() {
reloadConfig();
MobPowersCustomConfig mobPowersCustomConfig = new MobPowersCustomConfig();
mobPowersCustomConfig.reloadCustomConfig();
LootCustomConfig lootCustomConfig = new LootCustomConfig();
lootCustomConfig.reloadLootConfig();
TranslationCustomConfig translationCustomConfig = new TranslationCustomConfig();
translationCustomConfig.reloadCustomConfig();
ConfigValues configValues = new ConfigValues();
configValues.initializeConfigValues();
getLogger().info("EliteMobs config reloaded!");
}
use of com.magmaguy.elitemobs.config.ConfigValues in project EliteMobs by MagmaGuy.
the class EliteMobs method onEnable.
@Override
public void onEnable() {
getLogger().info("EliteMobs - Enabled!");
//Load loot from config
loadConfiguration();
MobPowersCustomConfig mobPowersCustomConfig = new MobPowersCustomConfig();
mobPowersCustomConfig.initializeMobPowersConfig();
LootCustomConfig lootCustomConfig = new LootCustomConfig();
lootCustomConfig.LootCustomConfig();
TranslationCustomConfig translationCustomConfig = new TranslationCustomConfig();
translationCustomConfig.initializeTranslationConfig();
ConfigValues configValues = new ConfigValues();
configValues.initializeConfigValues();
//Parse loot
EliteDropsHandler superDrops = new EliteDropsHandler();
superDrops.superDropParser();
//Get world list
worldScanner();
//Start the repeating tasks such as scanners
repeatingTaskRunner();
//Hook up all listeners, some depend on config
this.getServer().getPluginManager().registerEvents(this, this);
//Mob damage
this.getServer().getPluginManager().registerEvents(new DamageHandler(this), this);
//Mob loot
this.getServer().getPluginManager().registerEvents(new DropsHandler(), this);
//getloot GUI
this.getServer().getPluginManager().registerEvents(new LootGUI(), this);
//Minor mob powers
for (String string : MetadataHandler.minorPowerList()) {
//don't load powers that require no even listeners
if (!(string.equalsIgnoreCase("MovementSpeed")) && !(string.equalsIgnoreCase("Invisibility")) && !(string.equalsIgnoreCase("DoubleHealth")) && !(string.equalsIgnoreCase("DoubleDamage"))) {
try {
String earlypath = "com.magmaguy.elitemobs.minorpowers.";
String finalString = earlypath + string;
Class<?> clazz = Class.forName(finalString);
Object instance = clazz.newInstance();
this.getServer().getPluginManager().registerEvents((Listener) instance, this);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
}
}
for (String string : MetadataHandler.majorPowerList()) {
//don't load powers that require no even listeners
try {
String earlypath = "com.magmaguy.elitemobs.majorpowers.";
String finalString = earlypath + string;
Class<?> clazz = Class.forName(finalString);
Object instance = clazz.newInstance();
this.getServer().getPluginManager().registerEvents((Listener) instance, this);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
}
//Mob scanner
this.getServer().getPluginManager().registerEvents(new MobScanner(this), this);
//Natural EliteMobs Spawning
if (ConfigValues.defaultConfig.getBoolean("Natural EliteMob spawning")) {
this.getServer().getPluginManager().registerEvents(new NaturalMobSpawner(this), this);
getLogger().info("EliteMobs - Natural EliteMob Spawning enabled!");
}
//Natural Mob Metadata Assigner
this.getServer().getPluginManager().registerEvents(new NaturalMobMetadataAssigner(this), this);
//Visual effects
this.getServer().getPluginManager().registerEvents(new MinorPowerPowerStance(), this);
this.getServer().getPluginManager().registerEvents(new MajorPowerPowerStance(), this);
//Loot
if (ConfigValues.defaultConfig.getBoolean("Aggressive EliteMobs can drop config loot (level 5 EliteMobs and up)")) {
this.getServer().getPluginManager().registerEvents(new EliteDropsHandler(), this);
getLogger().info("EliteMobs - EliteMob loot enabled!");
}
//Minecraft behavior canceller
if (ConfigValues.defaultConfig.getBoolean("Prevent creepers from killing passive mobs")) {
this.getServer().getPluginManager().registerEvents(new PreventCreeperPassiveEntityDamage(this), this);
getLogger().info("EliteMobs - Creeper passive mob collateral damage canceller enabled!");
}
this.getServer().getPluginManager().registerEvents(new ChunkUnloadMetadataPurge(this), this);
//Commands
this.getCommand("elitemobs").setExecutor(new CommandHandler(this));
}
use of com.magmaguy.elitemobs.config.ConfigValues in project EliteMobs by MagmaGuy.
the class ReloadConfigCommandHandler method reloadConfiguration.
public void reloadConfiguration() {
//Reload all configs
Bukkit.getPluginManager().getPlugin(MetadataHandler.ELITE_MOBS).reloadConfig();
MobPowersCustomConfig mobPowersCustomConfig = new MobPowersCustomConfig();
mobPowersCustomConfig.reloadCustomConfig();
LootCustomConfig lootCustomConfig = new LootCustomConfig();
lootCustomConfig.reloadLootConfig();
TranslationCustomConfig translationCustomConfig = new TranslationCustomConfig();
translationCustomConfig.reloadCustomConfig();
ConfigValues configValues = new ConfigValues();
configValues.initializeConfigValues();
//reload config-based initialized data
EliteDropsHandler eliteDropsHandler = new EliteDropsHandler();
eliteDropsHandler.superDropParser();
Bukkit.getLogger().info("EliteMobs config reloaded!");
}
Aggregations