use of com.github.sirblobman.combatlogx.api.object.UntagReason in project CombatLogX by SirBlobman.
the class ListenerUntag method onUntag.
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onUntag(PlayerUntagEvent e) {
Player player = e.getPlayer();
LivingEntity previousEnemy = e.getPreviousEnemy();
UntagReason untagReason = e.getUntagReason();
ICombatLogX plugin = getCombatLogX();
IPunishManager punishManager = plugin.getPunishManager();
punishManager.punish(player, untagReason, previousEnemy);
sendUntagMessage(player, untagReason);
runUntagCommands(player, previousEnemy);
}
use of com.github.sirblobman.combatlogx.api.object.UntagReason in project CombatLogX by SirBlobman.
the class ListenerLogger method onUntag.
@EventHandler(priority = EventPriority.MONITOR)
public void onUntag(PlayerUntagEvent e) {
if (isDisabled("log-untag"))
return;
Player player = e.getPlayer();
LivingEntity enemy = e.getPreviousEnemy();
UntagReason untagReason = e.getUntagReason();
boolean isExpire = untagReason.isExpire();
String format = getLoggerFormat("untag-format");
String playerName = player.getName();
String enemyName = getEntityName(enemy);
String untagReasonName = untagReason.name();
String expireString = Boolean.toString(isExpire);
String message = format.replace("{player}", playerName).replace("{enemy}", enemyName).replace("{untag_reason}", untagReasonName).replace("{was_expire}", expireString);
appendLog(message);
}
Aggregations