use of com.github.sirblobman.combatlogx.api.object.TagReason in project CombatLogX by SirBlobman.
the class ListenerLogger method beforeTag.
@EventHandler(priority = EventPriority.MONITOR)
public void beforeTag(PlayerPreTagEvent e) {
if (isDisabled("log-pretag"))
return;
Player player = e.getPlayer();
LivingEntity enemy = e.getEnemy();
TagReason tagReason = e.getTagReason();
TagType tagType = e.getTagType();
String format = getLoggerFormat("pretag-format");
String playerName = player.getName();
String enemyName = getEntityName(enemy);
String tagReasonName = tagReason.name();
String tagTypeName = tagType.name();
String cancelledString = Boolean.toString(e.isCancelled());
String message = format.replace("{player}", playerName).replace("{enemy}", enemyName).replace("{tag_reason}", tagReasonName).replace("{tag_type}", tagTypeName).replace("{was_cancelled}", cancelledString);
appendLog(message);
}
use of com.github.sirblobman.combatlogx.api.object.TagReason in project CombatLogX by SirBlobman.
the class ListenerLogger method onTag.
@EventHandler(priority = EventPriority.MONITOR)
public void onTag(PlayerTagEvent e) {
if (isDisabled("log-tag"))
return;
Player player = e.getPlayer();
LivingEntity enemy = e.getEnemy();
TagReason tagReason = e.getTagReason();
TagType tagType = e.getTagType();
String format = getLoggerFormat("tag-format");
String playerName = player.getName();
String enemyName = getEntityName(enemy);
String tagReasonName = tagReason.name();
String tagTypeName = tagType.name();
String message = format.replace("{player}", playerName).replace("{enemy}", enemyName).replace("{tag_reason}", tagReasonName).replace("{tag_type}", tagTypeName);
appendLog(message);
}
use of com.github.sirblobman.combatlogx.api.object.TagReason in project CombatLogX by SirBlobman.
the class CombatManager method sendTagMessage.
private void sendTagMessage(Player player, LivingEntity enemy, TagType tagType, TagReason tagReason) {
if (tagType == TagType.DAMAGE) {
return;
}
String enemyName = getEntityName(player, enemy);
String enemyType = getEntityType(player, enemy);
String tagReasonString = tagReason.name().toLowerCase(Locale.US);
String tagTypeString = tagType.name().toLowerCase(Locale.US);
Replacer replacer = message -> message.replace("{enemy}", enemyName).replace("{mob_type}", enemyType);
String languagePath = ("tagged." + tagReasonString + "." + tagTypeString);
this.plugin.sendMessageWithPrefix(player, languagePath, replacer, true);
}
use of com.github.sirblobman.combatlogx.api.object.TagReason in project CombatLogX by SirBlobman.
the class ListenerLogger method onReTag.
@EventHandler(priority = EventPriority.MONITOR)
public void onReTag(PlayerReTagEvent e) {
if (isDisabled("log-retag"))
return;
Player player = e.getPlayer();
LivingEntity enemy = e.getEnemy();
TagReason tagReason = e.getTagReason();
TagType tagType = e.getTagType();
String format = getLoggerFormat("retag-format");
String playerName = player.getName();
String enemyName = getEntityName(enemy);
String tagReasonName = tagReason.name();
String tagTypeName = tagType.name();
String cancelledString = Boolean.toString(e.isCancelled());
String message = format.replace("{player}", playerName).replace("{enemy}", enemyName).replace("{tag_reason}", tagReasonName).replace("{tag_type}", tagTypeName).replace("{was_cancelled}", cancelledString);
appendLog(message);
}
Aggregations