Search in sources :

Example 21 with WarningMessage

use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.

the class SummonWolfEnchantment method summonSnoopy.

private static Wolf summonSnoopy(Player player) {
    CustomBossEntity customBossEntity = CustomBossEntity.createCustomBossEntity("summonable_wolf.yml");
    customBossEntity.setSpawnLocation(player.getLocation());
    customBossEntity.setLevel(ElitePlayerInventory.playerInventories.get(player.getUniqueId()).getFullPlayerTier(true));
    if (customBossEntity.getLivingEntity().getType() != EntityType.WOLF) {
        new WarningMessage("snoopy.yml boss file was not set to a wolf entity type! It must be a wolf for the summon mechanic to work correctly!");
        return null;
    }
    return (Wolf) customBossEntity.getLivingEntity();
}
Also used : WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage) Wolf(org.bukkit.entity.Wolf) CustomBossEntity(com.magmaguy.elitemobs.mobconstructor.custombosses.CustomBossEntity)

Example 22 with WarningMessage

use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.

the class SummonWolfEnchantment method summonGenericWolf.

private static Wolf summonGenericWolf(Player player) {
    CustomBossEntity customBossEntity = CustomBossEntity.createCustomBossEntity("summonable_wolf.yml");
    customBossEntity.setSpawnLocation(player.getLocation());
    customBossEntity.setLevel(ElitePlayerInventory.playerInventories.get(player.getUniqueId()).getFullPlayerTier(true));
    customBossEntity.spawn(false);
    if (customBossEntity.getCustomBossesConfigFields().getEntityType() != EntityType.WOLF) {
        new WarningMessage("snoopy.yml boss file was not set to a wolf entity type! It must be a wolf for the summon mechanic to work correctly!");
        return null;
    }
    return (Wolf) customBossEntity.getLivingEntity();
}
Also used : WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage) Wolf(org.bukkit.entity.Wolf) CustomBossEntity(com.magmaguy.elitemobs.mobconstructor.custombosses.CustomBossEntity)

Example 23 with WarningMessage

use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.

the class ItemLootShower method dropFiveHundred.

private void dropFiveHundred(Location location) {
    Item currencyItem;
    try {
        currencyItem = generateCurrencyItem(Material.getMaterial(EconomySettingsConfig.getLootShowerMaterial500()), location, 500);
    } catch (Exception ex) {
        new WarningMessage("Material for EliteMob shower 500 is invalid. Defaulting to diamond block.");
        currencyItem = generateCurrencyItem(Material.DIAMOND_BLOCK, location, 500);
    }
    currencyItem.setCustomName(ChatColorConverter.convert("&2" + 500 + " " + EconomySettingsConfig.getCurrencyName()));
    currencyItem.setCustomNameVisible(true);
}
Also used : Item(org.bukkit.entity.Item) WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage)

Example 24 with WarningMessage

use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.

the class LootTables method generateWeighedFixedItemStack.

private static ItemStack generateWeighedFixedItemStack(Player player) {
    double totalWeight = 0;
    for (ItemStack itemStack : CustomItem.getWeighedFixedItems().keySet()) {
        Double shouldntBeNull = CustomItem.getWeighedFixedItems().get(itemStack);
        if (shouldntBeNull != null)
            totalWeight += CustomItem.getWeighedFixedItems().get(itemStack);
        else
            new WarningMessage("Item " + itemStack.getItemMeta().getDisplayName() + " reported a null weight!");
    }
    ItemStack generatedItemStack = null;
    double random = Math.random() * totalWeight;
    for (ItemStack itemStack : CustomItem.getWeighedFixedItems().keySet()) {
        random -= CustomItem.getWeighedFixedItems().get(itemStack);
        if (random <= 0) {
            generatedItemStack = itemStack.clone();
            break;
        }
    }
    SoulbindEnchantment.addEnchantment(generatedItemStack, player);
    return generatedItemStack;
}
Also used : WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage) ItemStack(org.bukkit.inventory.ItemStack)

Example 25 with WarningMessage

use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.

the class ItemLootShower method dropTen.

private void dropTen(Location location) {
    Item currencyItem;
    try {
        currencyItem = generateCurrencyItem(Material.getMaterial(EconomySettingsConfig.getLootShowerMaterial10()), location, 10);
    } catch (Exception ex) {
        new WarningMessage("Material for EliteMob shower 10 is invalid. Defaulting to Gold block.");
        currencyItem = generateCurrencyItem(Material.GOLD_BLOCK, location, 10);
    }
    currencyItem.setCustomName(ChatColorConverter.convert("&a" + 10 + " " + EconomySettingsConfig.getCurrencyName()));
    currencyItem.setCustomNameVisible(true);
}
Also used : Item(org.bukkit.entity.Item) WarningMessage(com.magmaguy.elitemobs.utils.WarningMessage)

Aggregations

WarningMessage (com.magmaguy.elitemobs.utils.WarningMessage)76 InfoMessage (com.magmaguy.elitemobs.utils.InfoMessage)11 Vector (org.bukkit.util.Vector)11 Item (org.bukkit.entity.Item)10 File (java.io.File)9 CustomBossEntity (com.magmaguy.elitemobs.mobconstructor.custombosses.CustomBossEntity)8 FlagConflictException (com.sk89q.worldguard.protection.flags.registry.FlagConflictException)7 RegionManager (com.sk89q.worldguard.protection.managers.RegionManager)6 RegionContainer (com.sk89q.worldguard.protection.regions.RegionContainer)6 ArrayList (java.util.ArrayList)6 ZipFile (com.magmaguy.elitemobs.utils.ZipFile)5 GlobalProtectedRegion (com.sk89q.worldguard.protection.regions.GlobalProtectedRegion)5 ProtectedRegion (com.sk89q.worldguard.protection.regions.ProtectedRegion)5 Location (org.bukkit.Location)5 ItemStack (org.bukkit.inventory.ItemStack)5 CustomBossesConfigFields (com.magmaguy.elitemobs.config.custombosses.CustomBossesConfigFields)3 Minidungeon (com.magmaguy.elitemobs.dungeons.Minidungeon)3 IOException (java.io.IOException)3 Material (org.bukkit.Material)3 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)3