Search in sources :

Example 1 with HologramRunnable

use of com.nextplugins.economy.ranking.types.HologramRunnable in project NextEconomy by NextPlugins.

the class CustomRankingRegistry method register.

public void register() {
    val pluginManager = Bukkit.getPluginManager();
    String type = RankingValue.get(RankingValue::npcType);
    if (type.equalsIgnoreCase("nothing")) {
        plugin.getLogger().info("Cancelando registro de ranking por NPC, Holograma e ArmorStand, você desativou na ranking.yml.");
        return;
    }
    if (!pluginManager.isPluginEnabled("CMI") && !pluginManager.isPluginEnabled("HolographicDisplays")) {
        plugin.getLogger().log(Level.WARNING, "Dependência não encontrada ({0}) O ranking em NPC, Holograma e ArmorStand não serão usados.", "HolographicDisplays ou CMI");
        return;
    }
    holographicDisplays = pluginManager.isPluginEnabled("HolographicDisplays");
    boolean isNpc = type.equalsIgnoreCase("npc");
    if (isNpc && !pluginManager.isPluginEnabled("ProtocolLib")) {
        plugin.getLogger().log(Level.WARNING, "Dependência não encontrada ({0}) O ranking em NPC não será usado.", "ProtocolLib");
        return;
    }
    LocationLoader.of(plugin, plugin.getLocationManager()).loadLocations();
    if (isNpc)
        runnable = new NPCRunnable(plugin, holographicDisplays);
    else if (type.equalsIgnoreCase("armorstand"))
        runnable = new ArmorStandRunnable(plugin, plugin.getLocationManager(), plugin.getRankingStorage(), holographicDisplays);
    else
        runnable = new HologramRunnable(plugin, plugin.getLocationManager(), plugin.getRankingStorage(), holographicDisplays);
    enabled = true;
    plugin.getLogger().info("Sistema de NPC e ArmorStand registrado com sucesso.");
}
Also used : lombok.val(lombok.val) HologramRunnable(com.nextplugins.economy.ranking.types.HologramRunnable) ArmorStandRunnable(com.nextplugins.economy.ranking.types.ArmorStandRunnable) RankingValue(com.nextplugins.economy.configuration.RankingValue) NPCRunnable(com.nextplugins.economy.ranking.types.NPCRunnable)

Aggregations

RankingValue (com.nextplugins.economy.configuration.RankingValue)1 ArmorStandRunnable (com.nextplugins.economy.ranking.types.ArmorStandRunnable)1 HologramRunnable (com.nextplugins.economy.ranking.types.HologramRunnable)1 NPCRunnable (com.nextplugins.economy.ranking.types.NPCRunnable)1 lombok.val (lombok.val)1