Search in sources :

Example 11 with ICombatLogX

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

the class LandsExpansion method afterEnable.

@Override
public void afterEnable() {
    ICombatLogX plugin = getPlugin();
    ExpansionManager expansionManager = plugin.getExpansionManager();
    Optional<Expansion> optionalNewbieHelper = expansionManager.getExpansion("NewbieHelper");
    if (optionalNewbieHelper.isPresent()) {
        new ListenerLands(this).register();
    }
}
Also used : ListenerLands(combatlogx.expansion.compatibility.region.lands.listener.ListenerLands) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) RegionExpansion(com.github.sirblobman.combatlogx.api.expansion.region.RegionExpansion) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 12 with ICombatLogX

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

the class HookMVdWPlaceholderAPI method getEnemyPlaceholder.

private String getEnemyPlaceholder(Player player, String enemyPlaceholder) {
    ICombatLogX plugin = this.expansion.getPlugin();
    ICombatManager combatManager = plugin.getCombatManager();
    LivingEntity enemy = combatManager.getEnemy(player);
    if (enemy instanceof Player) {
        Player playerEnemy = (Player) enemy;
        String placeholder = String.format(Locale.US, "{%s}", enemyPlaceholder);
        return PlaceholderAPI.replacePlaceholders(playerEnemy, placeholder);
    }
    return getUnknownEnemy(plugin, player);
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) Player(org.bukkit.entity.Player) ICombatManager(com.github.sirblobman.combatlogx.api.manager.ICombatManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 13 with ICombatLogX

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

the class HookMVdWPlaceholderAPI method getNewbieHelperPVPStatus.

private String getNewbieHelperPVPStatus(Player player) {
    ICombatLogX plugin = this.expansion.getPlugin();
    LanguageManager languageManager = plugin.getLanguageManager();
    boolean pvp = true;
    Expansion expansion = getNewbieHelper();
    if (expansion != null) {
        NewbieHelperExpansion newbieHelperExpansion = (NewbieHelperExpansion) expansion;
        PVPManager pvpManager = newbieHelperExpansion.getPVPManager();
        pvp = !pvpManager.isDisabled(player);
    }
    String messagePath = ("placeholder.pvp-status." + (pvp ? "enabled" : "disabled"));
    return languageManager.getMessage(player, messagePath, null, true);
}
Also used : NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) PVPManager(combatlogx.expansion.newbie.helper.manager.PVPManager) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX) NewbieHelperExpansion(combatlogx.expansion.newbie.helper.NewbieHelperExpansion) Expansion(com.github.sirblobman.combatlogx.api.expansion.Expansion)

Example 14 with ICombatLogX

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

the class IridiumSkyblockExpansion method onEnable.

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

Example 15 with ICombatLogX

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

the class SuperVanishExpansion method onEnable.

@Override
public void onEnable() {
    if (!checkDependency("SuperVanish", true) && !checkDependency("PremiumVanish", true)) {
        ICombatLogX plugin = getPlugin();
        ExpansionManager expansionManager = plugin.getExpansionManager();
        expansionManager.disableExpansion(this);
        return;
    }
    new ListenerVanish(this).register();
}
Also used : ListenerVanish(combatlogx.expansion.compatibility.supervanish.listener.ListenerVanish) ExpansionManager(com.github.sirblobman.combatlogx.api.expansion.ExpansionManager) 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