Search in sources :

Example 1 with CustomLootTable

use of com.magmaguy.elitemobs.items.customloottable.CustomLootTable in project EliteMobs by MagmaGuy.

the class CustomTreasureChestConfigFields method processConfigFields.

@Override
public void processConfigFields() {
    this.isEnabled = processBoolean("isEnabled", isEnabled, false, false);
    this.chestMaterial = processEnum("chestType", chestMaterial, Material.CHEST, Material.class, true);
    this.facing = processEnum("facing", facing, BlockFace.NORTH, BlockFace.class, true);
    this.chestTier = processInt("chestTier", chestTier, 0, true);
    this.worldName = processString("location", worldName, null, false);
    if (worldName != null)
        worldName = worldName.split(",")[0];
    this.dropStyle = processEnum("dropStyle", dropStyle, TreasureChest.DropStyle.SINGLE, TreasureChest.DropStyle.class, true);
    this.restockTimer = processInt("restockTimer", restockTimer, 0, true);
    this.lootList = processStringList("lootList", lootList, new ArrayList<>(), true);
    this.customLootTable = new CustomLootTable(this);
    this.mimicChance = processDouble("mimicChance", mimicChance, 0, true);
    this.mimicCustomBossesList = processStringList("mimicCustomBossesList", mimicCustomBossesList, new ArrayList<>(), true);
    this.restockTime = processLong("restockTime", restockTimer, 0, false);
    this.restockTimers = processStringList("restockTimers", restockTimers, new ArrayList<>(), false);
    this.effects = processStringList("effects", effects, new ArrayList<>(), false);
    this.locations = processStringList("locations", locations, new ArrayList<>(), false);
    this.location = processLocation("location", location, null, false);
    if (location == null && locations.isEmpty())
        new InfoMessage("Custom Treasure Chest in file " + filename + " does not have a defined location(s)! It will not spawn.");
    else
        new TreasureChest(this, location, restockTime);
    for (String string : locations) {
        String[] strings = string.split(":");
        Location location = ConfigurationLocation.serialize(strings[0]);
        if (location == null) {
            new WarningMessage("Bad location entry in locations for " + filename + " . Entry: " + strings[0]);
            continue;
        }
        long timestamp = 0;
        if (strings.length > 1) {
            try {
                timestamp = Long.parseLong(strings[1]);
            } catch (Exception exception) {
                new WarningMessage("Bad unix timestamp in locations for " + filename + " . Entry: " + strings[0]);
            }
        }
        new TreasureChest(this, location, timestamp);
    }
}
Also used : TreasureChest(com.magmaguy.elitemobs.treasurechest.TreasureChest) WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage) BlockFace(org.bukkit.block.BlockFace) ArrayList(java.util.ArrayList) Material(org.bukkit.Material) CustomLootTable(com.magmaguy.elitemobs.items.customloottable.CustomLootTable) InfoMessage(com.magmaguy.elitemobs.utils.InfoMessage) ConfigurationLocation(com.magmaguy.elitemobs.utils.ConfigurationLocation) Location(org.bukkit.Location)

Example 2 with CustomLootTable

use of com.magmaguy.elitemobs.items.customloottable.CustomLootTable 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)

Aggregations

CustomLootTable (com.magmaguy.elitemobs.items.customloottable.CustomLootTable)2 TreasureChest (com.magmaguy.elitemobs.treasurechest.TreasureChest)1 ConfigurationLocation (com.magmaguy.elitemobs.utils.ConfigurationLocation)1 InfoMessage (com.magmaguy.elitemobs.utils.InfoMessage)1 WarningMessage (com.magmaguy.elitemobs.utils.WarningMessage)1 ArrayList (java.util.ArrayList)1 Location (org.bukkit.Location)1 Material (org.bukkit.Material)1 BlockFace (org.bukkit.block.BlockFace)1 EntityType (org.bukkit.entity.EntityType)1