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();
}
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();
}
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);
}
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;
}
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);
}
Aggregations