use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.
the class ItemLootShower method dropOneThousand.
private void dropOneThousand(Location location) {
Item currencyItem;
try {
currencyItem = generateCurrencyItem(Material.getMaterial(EconomySettingsConfig.getLootShowerMaterial1000()), location, 1000);
} catch (Exception ex) {
new WarningMessage("Material for EliteMob shower 1000 is invalid. Defaulting to nether star.");
currencyItem = generateCurrencyItem(Material.NETHER_STAR, location, 1000);
}
currencyItem.setCustomName(ChatColorConverter.convert("&2" + 1000 + " " + EconomySettingsConfig.getCurrencyName()));
currencyItem.setCustomNameVisible(true);
}
use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.
the class Minidungeon method loadWorld.
private void loadWorld(Player player) {
try {
world = MinidungeonWorldLoader.loadWorld(this);
if (world == null) {
player.sendMessage("Failed to get world " + this.dungeonPackagerConfigFields.getWorldName() + " . Can not complete installation correctly.");
return;
}
WorldGuardCompatibility.protectWorldMinidugeonArea(world.getSpawnLocation(), this);
player.teleport(world.getSpawnLocation());
player.sendMessage("Minidungeon " + dungeonPackagerConfigFields.getWorldName() + " has been loaded! The world is now loaded and the regional bosses are up.");
player.sendMessage(ChatColorConverter.convert("&cYou might want to do &a/em reload &cto fix the initial spawns, skins and wormholes!"));
if (dungeonPackagerConfigFields.isHasCustomModels())
if (!Bukkit.getPluginManager().isPluginEnabled("ModelEngine")) {
player.sendMessage(ChatColorConverter.convert("&c[EliteMobs] The dungeon you just installed has custom models, but you do not have Model Engine! Download it here if you want to use Custom Models: https://www.spigotmc.org/resources/conxeptworks-model-engine%E2%80%94ultimate-custom-entity-model-manager-1-14-1-18-1.79477/"));
player.sendMessage(ChatColorConverter.convert("&c[EliteMobs] Please note that currently only version 2.4.0 is supported!"));
} else
player.spigot().sendMessage(SpigotMessage.commandHoverMessage(ChatColorConverter.convert("&8[EliteMobs] &2The dungeon you just installed has Custom Models! " + "&2Click here to generate the EliteMobs resource pack for those models!"), "Clicking will run the command /em generateresourcepack", "/em generateresourcepack"));
isInstalled = true;
setWorldSpawn();
} catch (Exception exception) {
new WarningMessage("Warning: Failed to load the " + dungeonPackagerConfigFields.getWorldName() + " world!");
player.sendMessage("Warning: Failed to load the " + dungeonPackagerConfigFields.getWorldName() + " world!");
exception.printStackTrace();
}
if (isInstalled)
quantifyWorldBosses();
}
use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.
the class ItemLootShower method generateCurrencyItem.
private Item generateCurrencyItem(Material material, Location location, double value) {
ItemStack currencyItemStack = SoulbindEnchantment.addEnchantment(ItemStackGenerator.generateItemStack(material, "", Arrays.asList("EliteMobsCurrencyItem", value + "", ThreadLocalRandom.current().nextDouble() + "")), player);
int model = 1;
try {
model = EconomySettingsConfig.getThisConfiguration().getInt("lootShowerMaterial." + (int) value);
} catch (Exception ex) {
new WarningMessage("Failed to get coin model for value " + value + " !");
}
setCoinModel(currencyItemStack, model);
Item currencyItem = location.getWorld().dropItem(location.clone().add(new Vector(0, 1, 0)), currencyItemStack);
EntityTracker.registerVisualEffects(currencyItem);
currencyItem.setVelocity(new Vector((ThreadLocalRandom.current().nextDouble() - 0.5) / 2, 0.5, (ThreadLocalRandom.current().nextDouble() - 0.5) / 2));
SoulbindEnchantment.addPhysicalDisplay(currencyItem, this.player);
new Coin(value, player, currencyItem);
return currencyItem;
}
use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.
the class ItemLootShower method dropOneHundred.
private void dropOneHundred(Location location) {
Item currencyItem;
try {
currencyItem = generateCurrencyItem(Material.getMaterial(EconomySettingsConfig.getLootShowerMaterial100()), location, 100);
} catch (Exception ex) {
new WarningMessage("Material for EliteMob shower 100 is invalid. Defaulting to diamond.");
currencyItem = generateCurrencyItem(Material.DIAMOND, location, 100);
}
currencyItem.setCustomName(ChatColorConverter.convert("&2" + 100 + " " + EconomySettingsConfig.getCurrencyName()));
currencyItem.setCustomNameVisible(true);
}
use of com.magmaguy.elitemobs.utils.WarningMessage in project EliteMobs by MagmaGuy.
the class ItemLootShower method dropFive.
private void dropFive(Location location) {
Item currencyItem;
try {
currencyItem = generateCurrencyItem(Material.getMaterial(EconomySettingsConfig.getLootShowerMaterial5()), location, 5);
} catch (Exception ex) {
new WarningMessage("Material for EliteMob shower 5 is invalid. Defaulting to gold ingot.");
currencyItem = generateCurrencyItem(Material.GOLD_INGOT, location, 5);
}
currencyItem.setCustomName(ChatColorConverter.convert("&f" + 5 + " " + EconomySettingsConfig.getCurrencyName()));
currencyItem.setCustomNameVisible(true);
}
Aggregations