use of com.github.sirblobman.combatlogx.api.event.PlayerUntagEvent 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);
}
Aggregations