use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ListenerUntag method isKickReasonIgnored.
private boolean isKickReasonIgnored(String kickReason) {
ICombatLogX plugin = getCombatLogX();
ConfigurationManager configurationManager = plugin.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("punish.yml");
List<String> kickIgnoreList = configuration.getStringList("kick-ignore-list");
if (kickIgnoreList.isEmpty()) {
return false;
}
for (String kickIgnoreMessage : kickIgnoreList) {
if (kickReason.contains(kickIgnoreMessage)) {
return true;
}
}
return false;
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class ListenerUntag method sendUntagMessage.
private void sendUntagMessage(Player player, UntagReason untagReason) {
if (!untagReason.isExpire()) {
return;
}
ICombatLogX plugin = getCombatLogX();
String languagePath = ("combat-timer." + (untagReason == UntagReason.EXPIRE ? "expire" : "enemy-death"));
plugin.sendMessageWithPrefix(player, languagePath, null, true);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class CustomScoreboard method createObjective.
private void createObjective() {
Player player = getPlayer();
LanguageManager languageManager = getLanguageManager();
String title = languageManager.getMessage(player, "expansion.scoreboard.title", null, true);
String titleReplaced = replacePlaceholders(title);
ICombatLogX plugin = this.expansion.getPlugin();
MultiVersionHandler multiVersionHandler = plugin.getMultiVersionHandler();
ScoreboardHandler scoreboardHandler = multiVersionHandler.getScoreboardHandler();
Scoreboard scoreboard = getScoreboard();
this.objective = scoreboardHandler.createObjective(scoreboard, "combatlogx", "dummy", titleReplaced);
this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class CommandCombatTimer method checkSelf.
private void checkSelf(Player player) {
ICombatLogX plugin = getCombatLogX();
ICombatManager combatManager = plugin.getCombatManager();
LanguageManager languageManager = getLanguageManager();
if (combatManager.isInCombat(player)) {
double timeLeftMillis = combatManager.getTimerLeftMillis(player);
double timeLeftSeconds = (timeLeftMillis / 1_000.0D);
String decimalFormatString = languageManager.getMessage(player, "decimal-format", null, false);
DecimalFormat decimalFormat = new DecimalFormat(decimalFormatString);
String timeLeftString = decimalFormat.format(timeLeftSeconds);
Replacer replacer = message -> message.replace("{time_left}", timeLeftString);
sendMessageWithPrefix(player, "command.combat-timer.time-left-self", replacer, true);
return;
}
sendMessageWithPrefix(player, "error.self-not-in-combat", null, true);
}
use of com.github.sirblobman.combatlogx.api.ICombatLogX in project CombatLogX by SirBlobman.
the class CommandCombatLogXReload method execute.
@Override
protected boolean execute(CommandSender sender, String[] args) {
if (!checkPermission(sender, "combatlogx.command.combatlogx.reload", true)) {
return true;
}
ICombatLogX plugin = getCombatLogX();
plugin.onReload();
sendMessageWithPrefix(sender, "command.combatlogx.reload-success", null, true);
return true;
}
Aggregations