Search in sources :

Example 1 with LootGUI

use of com.magmaguy.elitemobs.commands.LootGUI 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));
}
Also used : TranslationCustomConfig(com.magmaguy.elitemobs.config.TranslationCustomConfig) EliteDropsHandler(com.magmaguy.elitemobs.elitedrops.EliteDropsHandler) ChunkUnloadMetadataPurge(com.magmaguy.elitemobs.collateralminecraftchanges.ChunkUnloadMetadataPurge) ConfigValues(com.magmaguy.elitemobs.config.ConfigValues) LootGUI(com.magmaguy.elitemobs.commands.LootGUI) MinorPowerPowerStance(com.magmaguy.elitemobs.powerstances.MinorPowerPowerStance) MobScanner(com.magmaguy.elitemobs.mobscanner.MobScanner) CommandHandler(com.magmaguy.elitemobs.commands.CommandHandler) NaturalMobSpawner(com.magmaguy.elitemobs.naturalmobspawner.NaturalMobSpawner) DamageHandler(com.magmaguy.elitemobs.mobcustomizer.DamageHandler) PreventCreeperPassiveEntityDamage(com.magmaguy.elitemobs.collateralminecraftchanges.PreventCreeperPassiveEntityDamage) MobPowersCustomConfig(com.magmaguy.elitemobs.config.MobPowersCustomConfig) LootCustomConfig(com.magmaguy.elitemobs.config.LootCustomConfig) NaturalMobMetadataAssigner(com.magmaguy.elitemobs.naturalmobspawner.NaturalMobMetadataAssigner) EliteDropsHandler(com.magmaguy.elitemobs.elitedrops.EliteDropsHandler) DropsHandler(com.magmaguy.elitemobs.mobcustomizer.DropsHandler) MajorPowerPowerStance(com.magmaguy.elitemobs.powerstances.MajorPowerPowerStance)

Aggregations

ChunkUnloadMetadataPurge (com.magmaguy.elitemobs.collateralminecraftchanges.ChunkUnloadMetadataPurge)1 PreventCreeperPassiveEntityDamage (com.magmaguy.elitemobs.collateralminecraftchanges.PreventCreeperPassiveEntityDamage)1 CommandHandler (com.magmaguy.elitemobs.commands.CommandHandler)1 LootGUI (com.magmaguy.elitemobs.commands.LootGUI)1 ConfigValues (com.magmaguy.elitemobs.config.ConfigValues)1 LootCustomConfig (com.magmaguy.elitemobs.config.LootCustomConfig)1 MobPowersCustomConfig (com.magmaguy.elitemobs.config.MobPowersCustomConfig)1 TranslationCustomConfig (com.magmaguy.elitemobs.config.TranslationCustomConfig)1 EliteDropsHandler (com.magmaguy.elitemobs.elitedrops.EliteDropsHandler)1 DamageHandler (com.magmaguy.elitemobs.mobcustomizer.DamageHandler)1 DropsHandler (com.magmaguy.elitemobs.mobcustomizer.DropsHandler)1 MobScanner (com.magmaguy.elitemobs.mobscanner.MobScanner)1 NaturalMobMetadataAssigner (com.magmaguy.elitemobs.naturalmobspawner.NaturalMobMetadataAssigner)1 NaturalMobSpawner (com.magmaguy.elitemobs.naturalmobspawner.NaturalMobSpawner)1 MajorPowerPowerStance (com.magmaguy.elitemobs.powerstances.MajorPowerPowerStance)1 MinorPowerPowerStance (com.magmaguy.elitemobs.powerstances.MinorPowerPowerStance)1