Search in sources :

Example 11 with CustomBossesConfigFields

use of com.magmaguy.elitemobs.config.custombosses.CustomBossesConfigFields in project EliteMobs by MagmaGuy.

the class SpawnCommand method spawnCustomBossCommand.

public static void spawnCustomBossCommand(CommandSender commandSender, String fileName, String world, Vector coords, int level) {
    try {
        Location location = new Location(Bukkit.getWorld(world), coords.getX(), coords.getY(), coords.getZ());
        CustomBossesConfigFields customBossesConfigFields = CustomBossesConfig.getCustomBoss(fileName);
        if (customBossesConfigFields == null) {
            commandSender.sendMessage("Filename " + fileName + " is not valid! Make sure you are writing the name of a configuration file in the custombosses folder!");
            return;
        }
        CustomBossEntity customBossEntity = new CustomBossEntity(customBossesConfigFields);
        customBossEntity.setSpawnLocation(location);
        customBossEntity.setLevel(level);
        customBossEntity.spawn(false);
    } catch (Exception e) {
        commandSender.sendMessage("[EliteMobs] World argument was not valid!");
    }
}
Also used : CustomBossesConfigFields(com.magmaguy.elitemobs.config.custombosses.CustomBossesConfigFields) CustomBossEntity(com.magmaguy.elitemobs.mobconstructor.custombosses.CustomBossEntity) Location(org.bukkit.Location)

Aggregations

CustomBossesConfigFields (com.magmaguy.elitemobs.config.custombosses.CustomBossesConfigFields)11 CustomBossEntity (com.magmaguy.elitemobs.mobconstructor.custombosses.CustomBossEntity)5 WarningMessage (com.magmaguy.elitemobs.utils.WarningMessage)4 Location (org.bukkit.Location)4 RegionalBossEntity (com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity)2 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)2 ChatColorConverter (com.magmaguy.elitemobs.ChatColorConverter)1 MetadataHandler (com.magmaguy.elitemobs.MetadataHandler)1 NewMinidungeonRelativeBossLocationEvent (com.magmaguy.elitemobs.api.internal.NewMinidungeonRelativeBossLocationEvent)1 RemovalReason (com.magmaguy.elitemobs.api.internal.RemovalReason)1 CustomBossesConfig (com.magmaguy.elitemobs.config.custombosses.CustomBossesConfig)1 CustomTreasureChestConfigFields (com.magmaguy.elitemobs.config.customtreasurechests.CustomTreasureChestConfigFields)1 CustomTreasureChestsConfig (com.magmaguy.elitemobs.config.customtreasurechests.CustomTreasureChestsConfig)1 DungeonPackagerConfigFields (com.magmaguy.elitemobs.config.dungeonpackager.DungeonPackagerConfigFields)1 Minidungeon (com.magmaguy.elitemobs.dungeons.Minidungeon)1 MinidungeonWorldLoader (com.magmaguy.elitemobs.dungeons.worlds.MinidungeonWorldLoader)1 EntityTracker (com.magmaguy.elitemobs.entitytracker.EntityTracker)1 EliteEntity (com.magmaguy.elitemobs.mobconstructor.EliteEntity)1 GenericRotationMatrixMath (com.magmaguy.elitemobs.powerstances.GenericRotationMatrixMath)1 WorldGuardCompatibility (com.magmaguy.elitemobs.thirdparty.worldguard.WorldGuardCompatibility)1