Search in sources :

Example 1 with ITimerManager

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

the class CombatManager method untag.

@Override
public void untag(Player player, UntagReason untagReason) {
    Validate.notNull(player, "player must not be null!");
    Validate.notNull(untagReason, "untagReason must not be null!");
    if (!isInCombat(player)) {
        return;
    }
    UUID uuid = player.getUniqueId();
    this.combatMap.remove(uuid);
    ITimerManager timerManager = this.plugin.getTimerManager();
    timerManager.remove(player);
    LivingEntity previousEnemy = this.enemyMap.remove(uuid);
    PlayerUntagEvent event = new PlayerUntagEvent(player, untagReason, previousEnemy);
    PluginManager pluginManager = Bukkit.getPluginManager();
    pluginManager.callEvent(event);
}
Also used : ITimerManager(com.github.sirblobman.combatlogx.api.manager.ITimerManager) LivingEntity(org.bukkit.entity.LivingEntity) PluginManager(org.bukkit.plugin.PluginManager) PlayerUntagEvent(com.github.sirblobman.combatlogx.api.event.PlayerUntagEvent) UUID(java.util.UUID)

Example 2 with ITimerManager

use of com.github.sirblobman.combatlogx.api.manager.ITimerManager 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 3 with ITimerManager

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

the class ScoreboardExpansion method onEnable.

@Override
public void onEnable() {
    ICombatLogX plugin = getPlugin();
    ITimerManager timerManager = plugin.getTimerManager();
    timerManager.addUpdaterTask(new ScoreboardUpdater(this));
}
Also used : ITimerManager(com.github.sirblobman.combatlogx.api.manager.ITimerManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Example 4 with ITimerManager

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

the class BossBarExpansion method onEnable.

@Override
public void onEnable() {
    ICombatLogX plugin = getPlugin();
    ITimerManager timerManager = plugin.getTimerManager();
    timerManager.addUpdaterTask(new BossBarUpdater(this));
}
Also used : ITimerManager(com.github.sirblobman.combatlogx.api.manager.ITimerManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Aggregations

ITimerManager (com.github.sirblobman.combatlogx.api.manager.ITimerManager)4 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)3 PlayerUntagEvent (com.github.sirblobman.combatlogx.api.event.PlayerUntagEvent)1 ExpansionManager (com.github.sirblobman.combatlogx.api.expansion.ExpansionManager)1 UUID (java.util.UUID)1 Logger (java.util.logging.Logger)1 LivingEntity (org.bukkit.entity.LivingEntity)1 PluginManager (org.bukkit.plugin.PluginManager)1