Search in sources :

Example 31 with ICombatLogX

use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.

the class StoredInventory method saveItemStack.

private static void saveItemStack(CitizensExpansion expansion, ConfigurationSection section, String path, ItemStack item) {
    if (item == null) {
        section.set(path, null);
        return;
    }
    ICombatLogX plugin = expansion.getPlugin();
    MultiVersionHandler multiVersionHandler = plugin.getMultiVersionHandler();
    ItemHandler itemHandler = multiVersionHandler.getItemHandler();
    String base64 = itemHandler.toBase64String(item);
    section.set(path, base64);
}
Also used : MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) ItemHandler(com.github.sirblobman.api.nms.ItemHandler) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 32 with ICombatLogX

use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.

the class ActionBarExpansion method onEnable.

@Override
public void onEnable() {
    ICombatLogX plugin = getPlugin();
    int minorVersion = VersionUtility.getMinorVersion();
    if (minorVersion < 8) {
        Logger logger = getLogger();
        logger.warning("This expansion requires Spigot 1.8.8 or higher.");
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    ITimerManager timerManager = plugin.getTimerManager();
    timerManager.addUpdaterTask(new ActionBarUpdater(this));
}
Also used : ITimerManager(com.github.sirblobman.combatlogx.api.manager.ITimerManager) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) Logger(java.util.logging.Logger)

Example 33 with ICombatLogX

use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.

the class ActionBarUpdater method replacePlaceholders.

private String replacePlaceholders(Player player, String message, long timeLeftMillis) {
    if (message.contains("{bars}")) {
        String bars = getBars(player, timeLeftMillis);
        message = message.replace("{bars}", bars);
    }
    ICombatLogX combatLogX = getCombatLogX();
    ICombatManager combatManager = combatLogX.getCombatManager();
    LivingEntity enemy = combatManager.getEnemy(player);
    return combatManager.replaceVariables(player, enemy, message);
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) ICombatManager(com.github.sirblobman.combatlogx.api.manager.ICombatManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 34 with ICombatLogX

use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.

the class EssentialsExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("Essentials", true)) {
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerEssentials(this).register();
}
Also used : ListenerEssentials(combatlogx.expansion.compatibility.essentials.listener.ListenerEssentials) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 35 with ICombatLogX

use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.

the class FabledSkyBlockExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("FabledSkyBlock", true)) {
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerFabledSkyBlock(this).register();
}
Also used : ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ListenerFabledSkyBlock(combatlogx.expansion.compatibility.fabled.skyblock.listener.ListenerFabledSkyBlock) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Aggregations

ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)96 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)24 ICombatManager (com.github.sirblobman.combatlogx.api.manager.ICombatManager)19 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)19 Player (org.bukkit.entity.Player)18 JavaPlugin (org.bukkit.plugin.java.JavaPlugin)14 LivingEntity (org.bukkit.entity.LivingEntity)13 LanguageManager (com.github.sirblobman.api.language.LanguageManager)12 Logger (java.util.logging.Logger)11 ConfigurationManager (com.github.sirblobman.api.configuration.ConfigurationManager)10 MultiVersionHandler (com.github.sirblobman.api.nms.MultiVersionHandler)9 PlayerDataManager (com.github.sirblobman.api.configuration.PlayerDataManager)8 Expansion (com.github.sirblobman.combatlogx.api.expansion.Expansion)8 List (java.util.List)8 Replacer (com.github.sirblobman.api.language.Replacer)6 EntityHandler (com.github.sirblobman.api.nms.EntityHandler)5 State (com.github.sirblobman.combatlogx.api.expansion.Expansion.State)5 Collections (java.util.Collections)5 EventHandler (org.bukkit.event.EventHandler)5 NewbieHelperExpansion (combatlogx.expansion.newbie.helper.NewbieHelperExpansion)4