Search in sources :

Example 81 with EntityType

use of org.bukkit.entity.EntityType in project BKCommonLib by bergerhealer.

the class CreaturePreSpawnHandler_Spigot method handleMobsFor.

private static List<Object> handleMobsFor(World world, Object blockposition, List<Object> mobs) {
    try {
        // There is no use wasting CPU time when no one handles the event!
        if (LogicUtil.nullOrEmpty(mobs) || !CommonUtil.hasHandlers(CreaturePreSpawnEvent.getHandlerList())) {
            return mobs;
        }
        // Wrap the parameters and send the event along
        BlockPositionHandle pos = BlockPositionHandle.createHandle(blockposition);
        // Check all instances of SpawnRateHandle if they need to be cancelled
        // If they're cancelled, initialize a new List with those entries omitted
        CommonEventFactory eventFactory = CommonPlugin.getInstance().getEventFactory();
        List<Object> result = mobs;
        int numMobs = mobs.size();
        for (int n = 0; n < numMobs; n++) {
            SpawnRateHandle handle = SpawnRateHandle.createHandle(mobs.get(n));
            EntityType entityType = CommonEntityType.byNMSEntityClass(handle.getEntityClass()).entityType;
            if (eventFactory.handleCreaturePreSpawn(world, pos.getX(), pos.getY(), pos.getZ(), entityType)) {
                // add this entry to the list.
                if (result != mobs) {
                    result.add(handle.getRaw());
                }
            } else if (result == mobs) {
                // Create a new List of stuff, omit the entry that was cancelled
                result = new ArrayList<Object>();
                result.addAll(mobs.subList(0, n));
            }
        }
        return result;
    } catch (Throwable t) {
        Logging.LOGGER.log(Level.SEVERE, "Failed to handle mob pre-spawn event", t);
        return mobs;
    }
}
Also used : SpawnRateHandle(com.bergerkiller.generated.net.minecraft.world.level.biome.BiomeSettingsMobsHandle.SpawnRateHandle) EntityType(org.bukkit.entity.EntityType) CommonEntityType(com.bergerkiller.bukkit.common.entity.CommonEntityType) CommonEventFactory(com.bergerkiller.bukkit.common.events.CommonEventFactory) ArrayList(java.util.ArrayList) BlockPositionHandle(com.bergerkiller.generated.net.minecraft.core.BlockPositionHandle)

Example 82 with EntityType

use of org.bukkit.entity.EntityType in project MyPet by xXKeyleXx.

the class ConfigurationLoader method loadConfiguration.

public static void loadConfiguration() {
    MyPetApi.getPlugin().reloadConfig();
    FileConfiguration config = MyPetApi.getPlugin().getConfig();
    Misc.CONSUME_LEASH_ITEM = config.getBoolean("MyPet.Leash.Consume", false);
    Misc.ALLOW_RANGED_LEASHING = config.getBoolean("MyPet.Leash.AllowRanged", true);
    Misc.MAX_STORED_PET_COUNT = config.getInt("MyPet.Max-Stored-Pet-Count", Misc.MAX_STORED_PET_COUNT);
    Misc.RIGHT_CLICK_COMMAND = config.getString("MyPet.Right-Click-Command", Misc.RIGHT_CLICK_COMMAND);
    if (Misc.RIGHT_CLICK_COMMAND.startsWith("/")) {
        Misc.RIGHT_CLICK_COMMAND = Misc.RIGHT_CLICK_COMMAND.substring(1);
    }
    Misc.RECALL_PET_AFTER_DESPAWN = config.getBoolean("MyPet.Recall-Pet-After-Despawn", Misc.RECALL_PET_AFTER_DESPAWN);
    Update.ASYNC = config.getBoolean("MyPet.Update.In-Background", Update.ASYNC);
    Update.CHECK = config.getBoolean("MyPet.Update.Check", Update.CHECK);
    Update.DOWNLOAD = config.getBoolean("MyPet.Update.Download", Update.DOWNLOAD);
    Update.REPLACE_OLD = config.getBoolean("MyPet.Update.ReplaceOld", Update.REPLACE_OLD);
    Update.SHOW_OP = config.getBoolean("MyPet.Update.OP-Notification", Update.SHOW_OP);
    Skilltree.Skill.Beacon.HUNGER_DECREASE_TIME = config.getInt("MyPet.Skill.Beacon.HungerDecreaseTime", 100);
    Skilltree.Skill.Beacon.PARTY_SUPPORT = config.getBoolean("MyPet.Skill.Beacon.Party-Support", true);
    Skilltree.Skill.Beacon.DISABLE_HEAD_TEXTURE = config.getBoolean("MyPet.Skill.Beacon.Disable-Head-Textures", false);
    Skilltree.Skill.Backpack.OPEN_IN_CREATIVE = config.getBoolean("MyPet.Skill.Backpack.Creative", true);
    Skilltree.Skill.Backpack.DROP_WHEN_OWNER_DIES = config.getBoolean("MyPet.Skill.Backpack.DropWhenOwnerDies", false);
    Skilltree.Skill.Ride.HUNGER_PER_METER = config.getDouble("MyPet.Skill.Ride.HungerPerMeter", 0.01);
    Skilltree.Skill.Ride.PREVENT_TELEPORTATION = config.getBoolean("MyPet.Skill.Ride.Prevent-Teleportation-While-Riding", false);
    Skilltree.SWITCH_FEE_FIXED = config.getDouble("MyPet.Skilltree.SwitchFee.Fixed", 0.0);
    Skilltree.SWITCH_FEE_PERCENT = config.getInt("MyPet.Skilltree.SwitchFee.Percent", 5);
    Skilltree.SWITCH_FEE_ADMIN = config.getBoolean("MyPet.Skilltree.SwitchFee.Admin", false);
    Respawn.DISABLE_AUTO_RESPAWN = config.getBoolean("MyPet.Respawn.Time.Disabled", false);
    Respawn.TIME_FACTOR = config.getInt("MyPet.Respawn.Time.Default.Factor", 5);
    Respawn.TIME_PLAYER_FACTOR = config.getInt("MyPet.Respawn.Time.Player.Factor", 5);
    Respawn.TIME_FIXED = config.getInt("MyPet.Respawn.Time.Default.Fixed", 0);
    Respawn.TIME_PLAYER_FIXED = config.getInt("MyPet.Respawn.Time.Player.Fixed", 0);
    Respawn.COSTS_FACTOR = config.getDouble("MyPet.Respawn.EconomyCost.Factor", 1.0);
    Respawn.COSTS_FIXED = config.getDouble("MyPet.Respawn.EconomyCost.Fixed", 0.0);
    Skilltree.AUTOMATIC_SKILLTREE_ASSIGNMENT = config.getBoolean("MyPet.Skilltree.AutomaticAssignment", false);
    Skilltree.RANDOM_SKILLTREE_ASSIGNMENT = config.getBoolean("MyPet.Skilltree.RandomAssignment", false);
    Skilltree.CHOOSE_SKILLTREE_ONLY_ONCE = config.getBoolean("MyPet.Skilltree.ChooseOnce", false);
    Skilltree.PREVENT_LEVELLING_WITHOUT_SKILLTREE = config.getBoolean("MyPet.Skilltree.PreventLevellingWithout", true);
    Misc.OWNER_CAN_ATTACK_PET = config.getBoolean("MyPet.OwnerCanAttackPet", false);
    Misc.DISABLE_PET_VS_PLAYER = config.getBoolean("MyPet.DisablePetVersusPlayer", false);
    HungerSystem.USE_HUNGER_SYSTEM = config.getBoolean("MyPet.HungerSystem.Active", true);
    HungerSystem.HUNGER_SYSTEM_TIME = config.getInt("MyPet.HungerSystem.Time", 60);
    HungerSystem.HUNGER_SYSTEM_SATURATION_PER_FEED = config.getDouble("MyPet.HungerSystem.SaturationPerFeed", 6.0);
    HungerSystem.AFFECT_RIDE_SPEED = config.getBoolean("MyPet.HungerSystem.Affect-Ride-Speed", true);
    HungerSystem.AFFECT_BEACON_RANGE = config.getBoolean("MyPet.HungerSystem.Affect-Beacon-Range", true);
    Misc.RETAIN_EQUIPMENT_ON_TAME = config.getBoolean("MyPet.RetainEquipmentOnTame", true);
    Misc.INVISIBLE_LIKE_OWNER = config.getBoolean("MyPet.Make-Pet-Invisible-When-Owner-Is-Invisible", true);
    Misc.THROW_PLAYER_MOVE_EVENT_WHILE_RIDING = config.getBoolean("MyPet.Throw-PlayerMoveEvent-While-Riding", true);
    Misc.DISABLE_ALL_ACTIONBAR_MESSAGES = config.getBoolean("MyPet.Disable-All-Actionbar-Messages", false);
    Misc.OVERWRITE_LANGUAGE = config.getString("MyPet.OverwriteLanguages", "");
    LevelSystem.CALCULATION_MODE = config.getString("MyPet.LevelSystem.CalculationMode", "Default");
    Entity.MYPET_FOLLOW_START_DISTANCE = config.getDouble("MyPet.Entity.FollowStartDistance", 7.0D);
    Entity.SKIP_TARGET_AI_TICKS = config.getInt("MyPet.Entity.Skip-Target-AI-Ticks", 0);
    Log.LEVEL = config.getString("MyPet.Log.Level", Log.LEVEL);
    NameFilter.NAME_FILTER.clear();
    for (Object o : config.getList("MyPet.Name.Filter", Lists.newArrayList("whore", "fuck"))) {
        NameFilter.NAME_FILTER.add(String.valueOf(o));
    }
    Name.MAX_LENGTH = config.getInt("MyPet.Name.MaxLength", Name.MAX_LENGTH);
    Name.Tag.SHOW = config.getBoolean("MyPet.Name.Tag.Show", Name.Tag.SHOW);
    Name.Tag.PREFIX = Colorizer.setColors(config.getString("MyPet.Name.Tag.Prefix", Name.Tag.PREFIX));
    Name.Tag.SUFFIX = Colorizer.setColors(config.getString("MyPet.Name.Tag.Suffix", Name.Tag.SUFFIX));
    Repository.REPOSITORY_TYPE = config.getString("MyPet.Repository.Type", Repository.REPOSITORY_TYPE);
    Repository.CONVERT_FROM = config.getString("MyPet.Repository.ConvertFrom", Repository.CONVERT_FROM);
    Repository.EXTERNAL_LOAD_DELAY = config.getLong("MyPet.Repository.LoadDelay", Repository.EXTERNAL_LOAD_DELAY);
    Repository.MySQL.DATABASE = config.getString("MyPet.Repository.MySQL.Database", Repository.MySQL.DATABASE);
    Repository.MySQL.PREFIX = config.getString("MyPet.Repository.MySQL.TablePrefix", Repository.MySQL.PREFIX);
    Repository.MySQL.HOST = config.getString("MyPet.Repository.MySQL.Host", Repository.MySQL.HOST);
    Repository.MySQL.PASSWORD = config.getString("MyPet.Repository.MySQL.Password", Repository.MySQL.PASSWORD);
    Repository.MySQL.USER = config.getString("MyPet.Repository.MySQL.User", Repository.MySQL.USER);
    Repository.MySQL.PORT = config.getInt("MyPet.Repository.MySQL.Port", Repository.MySQL.PORT);
    Repository.MySQL.POOL_SIZE = config.getInt("MyPet.Repository.MySQL.MaxConnections", Repository.MySQL.POOL_SIZE);
    Repository.MySQL.CHARACTER_ENCODING = config.getString("MyPet.Repository.MySQL.CharacterEncoding", Repository.MySQL.CHARACTER_ENCODING);
    Repository.MongoDB.DATABASE = config.getString("MyPet.Repository.MongoDB.Database", Repository.MongoDB.DATABASE);
    Repository.MongoDB.PREFIX = config.getString("MyPet.Repository.MongoDB.CollectionPrefix", Repository.MongoDB.PREFIX);
    Repository.MongoDB.HOST = config.getString("MyPet.Repository.MongoDB.Host", Repository.MongoDB.HOST);
    Repository.MongoDB.PASSWORD = config.getString("MyPet.Repository.MongoDB.Password", Repository.MongoDB.PASSWORD);
    Repository.MongoDB.USER = config.getString("MyPet.Repository.MongoDB.User", Repository.MongoDB.USER);
    Repository.MongoDB.PORT = config.getInt("MyPet.Repository.MongoDB.Port", Repository.MongoDB.PORT);
    Misc.WIKI_URL = config.getString("MyPet.Info.Wiki-URL", Misc.WIKI_URL);
    Permissions.EXTENDED = config.getBoolean("MyPet.Permissions.Extended", false);
    Permissions.ENABLED = config.getBoolean("MyPet.Permissions.Enabled", true);
    Permissions.LEGACY = config.getBoolean("MyPet.Permissions.Legacy", Permissions.LEGACY);
    LevelSystem.Experience.LEVEL_CAP = config.getInt("MyPet.Exp.LevelCap", LevelSystem.Experience.LEVEL_CAP);
    LevelSystem.Experience.LOSS_PERCENT = config.getInt("MyPet.Exp.Loss.Percent", 0);
    LevelSystem.Experience.LOSS_FIXED = config.getDouble("MyPet.Exp.Loss.Fixed", 0.0);
    LevelSystem.Experience.DROP_LOST_EXP = config.getBoolean("MyPet.Exp.Loss.Drop", true);
    LevelSystem.Experience.ALLOW_LEVEL_DOWNGRADE = config.getBoolean("MyPet.Exp.Loss.Allow-Level-Drowngrade", false);
    LevelSystem.Experience.PASSIVE_PERCENT_PER_MONSTER = config.getInt("MyPet.Exp.Passive.PercentPerMonster", 25);
    LevelSystem.Experience.ALWAYS_GRANT_PASSIVE_XP = config.getBoolean("MyPet.Exp.Passive.Always-Grant-Passive-XP", true);
    LevelSystem.Experience.DAMAGE_WEIGHTED_EXPERIENCE_DISTRIBUTION = config.getBoolean("MyPet.Exp.DamageWeightedExperienceDistribution", true);
    LevelSystem.Experience.DISABLED_WORLDS.clear();
    LevelSystem.Experience.DISABLED_WORLDS.addAll(config.getStringList("MyPet.Exp.Disabled-Worlds"));
    LevelSystem.Experience.Modifier.GLOBAL = config.getDouble("MyPet.Exp.Modifier.Global", 1D);
    LevelSystem.Experience.Modifier.PERMISSION = config.getBoolean("MyPet.Exp.Modifier.Use-Permissions", false);
    if (config.contains("MyPet.Exp.Gain.PreventFromSpawnReason")) {
        LevelSystem.Experience.PREVENT_FROM_SPAWN_REASON.clear();
        if (config.isList("MyPet.Exp.Gain.PreventFromSpawnReason")) {
            for (String reason : config.getStringList("MyPet.Exp.Gain.PreventFromSpawnReason")) {
                reason = reason.toUpperCase();
                try {
                    CreatureSpawnEvent.SpawnReason.valueOf(reason);
                    LevelSystem.Experience.PREVENT_FROM_SPAWN_REASON.add(reason);
                } catch (Exception ignored) {
                }
            }
        }
    }
    File expConfigFile = new File(MyPetApi.getPlugin().getDataFolder().getPath(), "exp-config.yml");
    if (expConfigFile.exists()) {
        YamlConfiguration ymlcnf = new YamlConfiguration();
        try {
            ymlcnf.load(expConfigFile);
            config = ymlcnf;
        } catch (IOException | InvalidConfigurationException e) {
            MyPetApi.getLogger().warning("There was an error while loading exp-config.yml");
        }
    }
    for (EntityType entityType : EntityType.values()) {
        if (MonsterExperience.mobExp.containsKey(entityType.name())) {
            double max = config.getDouble("Default." + entityType.name() + ".Max", 0.);
            double min = config.getDouble("Default." + entityType.name() + ".Min", 0.);
            if (min == max) {
                MonsterExperience.getMonsterExperience(entityType.name()).setExp(max);
            } else {
                MonsterExperience.getMonsterExperience(entityType).setMin(min);
                MonsterExperience.getMonsterExperience(entityType).setMax(max);
            }
        }
    }
    ConfigurationSection customExpSection = config.getConfigurationSection("Custom");
    MonsterExperience.CUSTOM_MOB_EXP.clear();
    if (customExpSection != null) {
        for (String name : customExpSection.getKeys(false)) {
            MonsterExperience exp = new MonsterExperience(0, 0, name);
            double max = config.getDouble("Custom." + name + ".Max", 0.);
            double min = config.getDouble("Custom." + name + ".Min", 0.);
            if (min == max) {
                exp.setExp(max);
            } else {
                exp.setMin(min);
                exp.setMax(max);
            }
            MonsterExperience.addCustomExperience(exp);
        }
    }
    File petConfigFile = new File(MyPetApi.getPlugin().getDataFolder().getPath(), "pet-config.yml");
    if (petConfigFile.exists()) {
        YamlConfiguration ymlcnf = new YamlConfiguration();
        try {
            ymlcnf.load(petConfigFile);
            config = ymlcnf;
        } catch (IOException | InvalidConfigurationException e) {
            MyPetApi.getLogger().warning("There was an error while loading pet-config.yml");
        }
    }
    MyPet.Chicken.CAN_LAY_EGGS = config.getBoolean("MyPet.Pets.Chicken.CanLayEggs", true);
    MyPet.Cow.CAN_GIVE_MILK = config.getBoolean("MyPet.Pets.Cow.CanGiveMilk", true);
    MyPet.Sheep.CAN_BE_SHEARED = config.getBoolean("MyPet.Pets.Sheep.CanBeSheared", true);
    MyPet.Sheep.CAN_REGROW_WOOL = config.getBoolean("MyPet.Pets.Sheep.CanRegrowWool", true);
    MyPet.IronGolem.CAN_TOSS_UP = config.getBoolean("MyPet.Pets.IronGolem.CanTossUp", true);
    MyPet.Snowman.FIX_SNOW_TRACK = config.getBoolean("MyPet.Pets.Snowman.FixSnowTrack", true);
    MyPet.Mooshroom.CAN_GIVE_SOUP = config.getBoolean("MyPet.Pets.Mooshroom.CanGiveStew", false);
    MyPet.Bee.CAN_GLIDE = config.getBoolean("MyPet.Pets.Bee.CanGlide", true);
    MyPet.Bat.CAN_GLIDE = config.getBoolean("MyPet.Pets.Bat.CanGlide", true);
    MyPet.Blaze.CAN_GLIDE = config.getBoolean("MyPet.Pets.Blaze.CanGlide", true);
    MyPet.Ghast.CAN_GLIDE = config.getBoolean("MyPet.Pets.Ghast.CanGlide", true);
    MyPet.Chicken.CAN_GLIDE = config.getBoolean("MyPet.Pets.Chicken.CanGlide", true);
    MyPet.EnderDragon.CAN_GLIDE = config.getBoolean("MyPet.Pets.EnderDragon.CanGlide", true);
    MyPet.Wither.CAN_GLIDE = config.getBoolean("MyPet.Pets.Wither.CanGlide", true);
    MyPet.Vex.CAN_GLIDE = config.getBoolean("MyPet.Pets.Vex.CanGlide", true);
    MyPet.Parrot.CAN_GLIDE = config.getBoolean("MyPet.Pets.Parrot.CanGlide", true);
    MyPet.Phantom.CAN_GLIDE = config.getBoolean("MyPet.Pets.Phantom.CanGlide", true);
}
Also used : MonsterExperience(de.Keyle.MyPet.api.skill.experience.MonsterExperience) IOException(java.io.IOException) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) IOException(java.io.IOException) InvalidConfigurationException(org.bukkit.configuration.InvalidConfigurationException) InvalidConfigurationException(org.bukkit.configuration.InvalidConfigurationException) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) EntityType(org.bukkit.entity.EntityType) File(java.io.File) ConfigurationSection(org.bukkit.configuration.ConfigurationSection)

Example 83 with EntityType

use of org.bukkit.entity.EntityType in project EliteMobs by MagmaGuy.

the class KeepNeutralsAngry method showMeYouWarFace.

public static void showMeYouWarFace(EliteEntity eliteEntity) {
    // might already contain
    EntityType entityType = eliteEntity.getLivingEntity().getType();
    if (angryMobs.contains(eliteEntity))
        return;
    new BukkitRunnable() {

        @Override
        public void run() {
            // It is possible for entities to change type during combat, in which case they need to be wiped
            if (!eliteEntity.isValid() || !entityType.equals(eliteEntity.getLivingEntity().getType()) || entityType.equals(EntityType.WOLF) && ((Wolf) eliteEntity.getLivingEntity()).isTamed()) {
                cancel();
                angryMobs.remove(eliteEntity);
                return;
            }
            if (!eliteEntity.getLivingEntity().getType().equals(EntityType.LLAMA) && ((Mob) eliteEntity.getLivingEntity()).getTarget() != null)
                return;
            for (Player player : Bukkit.getOnlinePlayers()) if (!player.getGameMode().equals(GameMode.SPECTATOR) && !player.getGameMode().equals(GameMode.CREATIVE) && Objects.equals(player.getLocation().getWorld(), eliteEntity.getLocation().getWorld()) && player.getLocation().distance(eliteEntity.getLocation()) < Objects.requireNonNull(eliteEntity.getLivingEntity().getAttribute(Attribute.GENERIC_FOLLOW_RANGE)).getBaseValue()) {
                ((Mob) eliteEntity.getLivingEntity()).setTarget(player);
                return;
            }
            ((Mob) eliteEntity.getLivingEntity()).setTarget(null);
        }
    }.runTaskTimer(MetadataHandler.PLUGIN, 0, 20);
}
Also used : EntityType(org.bukkit.entity.EntityType) Mob(org.bukkit.entity.Mob) Player(org.bukkit.entity.Player) BukkitRunnable(org.bukkit.scheduler.BukkitRunnable)

Example 84 with EntityType

use of org.bukkit.entity.EntityType in project EliteMobs by MagmaGuy.

the class CustomBossesConfigFields method processConfigFields.

@Override
public void processConfigFields() {
    this.isEnabled = processBoolean("isEnabled", isEnabled, true, true);
    this.entityType = processEnum("entityType", entityType, EntityType.ZOMBIE, EntityType.class, true);
    this.name = processString("name", name, "Default Name", true);
    // Levels are strings because "dynamic" is a valid value
    this.level = processString("level", level, "dynamic", true);
    this.isPersistent = processBoolean("isPersistent", isPersistent, false, false);
    this.healthMultiplier = processDouble("healthMultiplier", healthMultiplier, 1D, false);
    this.damageMultiplier = processDouble("damageMultiplier", damageMultiplier, 1D, false);
    this.baby = processBoolean("isBaby", baby, false, false);
    this.dropsEliteMobsLoot = processBoolean("dropsEliteMobsLoot", dropsEliteMobsLoot, true, false);
    this.dropsVanillaLoot = processBoolean("dropsVanillaLoot", dropsVanillaLoot, true, false);
    this.dropsRandomLoot = processBoolean("dropsRandomLoot", dropsRandomLoot, true, false);
    this.frozen = processBoolean("frozen", frozen, false, false);
    this.reinforcement = processBoolean("reinforcement", reinforcement, false, false);
    this.onDeathCommands = processStringList("onDeathCommands", onDeathCommands, new ArrayList<>(), false);
    this.onSpawnCommands = processStringList("onSpawnCommands", onSpawnCommands, new ArrayList<>(), false);
    this.onCombatEnterCommands = processStringList("onCombatEnterCommands", onCombatEnterCommands, new ArrayList<>(), false);
    this.onCombatLeaveCommands = processStringList("onCombatLeaveCommands", onCombatLeaveCommands, new ArrayList<>(), false);
    this.deathMessages = processStringList("deathMessages", deathMessages, new ArrayList<>(), false);
    this.uniqueLootList = processStringList("uniqueLootList", uniqueLootList, new ArrayList<>(), false);
    this.customLootTable = new CustomLootTable(this);
    // this can't be converted directly to an enum list because there are some special string features in here
    this.powers = processStringList("powers", powers, new ArrayList<>(), false);
    this.onDamageMessages = processStringList("onDamageMessages", onDamageMessages, new ArrayList<>(), false);
    this.onDamagedMessages = processStringList("onDamagedMessages", onDamagedMessages, new ArrayList<>(), false);
    this.trails = processStringList("trails", trails, new ArrayList<>(), false);
    this.phases = processStringList("phases", phases, new ArrayList<>(), false);
    this.locationMessage = processString("locationMessage", locationMessage, null, false);
    this.mountedEntity = processString("mountedEntity", mountedEntity, null, false);
    this.spawnMessage = processString("spawnMessage", spawnMessage, null, false);
    this.deathMessage = processString("deathMessage", deathMessage, null, false);
    this.escapeMessage = processString("escapeMessage", escapeMessage, null, false);
    this.disguise = processString("disguise", disguise, null, false);
    this.customDisguiseData = processString("customDisguiseData", customDisguiseData, null, false);
    this.customModel = processString("customModel", customModel, null, false);
    this.announcementPriority = processInt("announcementPriority", announcementPriority, 0, false);
    this.followDistance = processInt("followDistance", followDistance, 0, false);
    this.spawnCooldown = processInt("spawnCooldown", spawnCooldown, 0, false);
    this.timeout = processInt("timeout", timeout, 0, false);
    this.leashRadius = processDouble("leashRadius", leashRadius, 0, false);
    this.helmet = processItemStack("helmet", helmet, null, false);
    this.chestplate = processItemStack("chestplate", chestplate, null, false);
    this.leggings = processItemStack("leggings", leggings, null, false);
    this.boots = processItemStack("boots", boots, null, false);
    this.mainHand = processItemStack("mainHand", mainHand, null, false);
    this.offHand = processItemStack("offHand", offHand, null, false);
    this.regionalBoss = processBoolean("isRegionalBoss", regionalBoss, false, false);
    this.onSpawnBlockStates = processStringList("onSpawnBlockStates", onSpawnBlockStates, new ArrayList<>(), false);
    this.onRemoveBlockStates = processStringList("onRemoveBlockStates", onRemoveBlockStates, new ArrayList<>(), false);
    cullReinforcements = processBoolean("cullReinforcements", cullReinforcements, true, false);
    damageModifiers = processDamageModifiers("damageModifiers", damageModifiers);
    if (MobCombatSettingsConfig.isNormalizeRegionalBosses() && isRegionalBoss())
        this.normalizedCombat = true;
    else
        this.normalizedCombat = processBoolean("normalizedCombat", normalizedCombat, false, false);
}
Also used : EntityType(org.bukkit.entity.EntityType) CustomLootTable(com.magmaguy.elitemobs.items.customloottable.CustomLootTable)

Example 85 with EntityType

use of org.bukkit.entity.EntityType in project EliteMobs by MagmaGuy.

the class QuestObjectives method generateRandomObjective.

private void generateRandomObjective(int questLevel) {
    int killAmount = ThreadLocalRandom.current().nextInt(1 + questLevel, 1 + questLevel * 10);
    EntityType entityType = QuestsConfig.getQuestEntityTypes().get(ThreadLocalRandom.current().nextInt(QuestsConfig.getQuestEntityTypes().size()));
    KillObjective killObjective = new DynamicKillObjective(killAmount, entityType, questLevel);
    this.objectives = Collections.singletonList(killObjective);
}
Also used : EntityType(org.bukkit.entity.EntityType)

Aggregations

EntityType (org.bukkit.entity.EntityType)109 ArrayList (java.util.ArrayList)29 ItemStack (org.bukkit.inventory.ItemStack)28 Material (org.bukkit.Material)23 Player (org.bukkit.entity.Player)23 Entity (org.bukkit.entity.Entity)19 Location (org.bukkit.Location)17 IOException (java.io.IOException)16 File (java.io.File)13 LivingEntity (org.bukkit.entity.LivingEntity)13 EventHandler (org.bukkit.event.EventHandler)12 PotionType (org.bukkit.potion.PotionType)12 HashMap (java.util.HashMap)10 ConfigurationSection (org.bukkit.configuration.ConfigurationSection)9 Block (org.bukkit.block.Block)8 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)8 World (org.bukkit.World)7 SpawnEgg (org.bukkit.material.SpawnEgg)7 UUID (java.util.UUID)5 Biome (org.bukkit.block.Biome)5