use of combatlogx.expansion.scoreboard.ScoreboardExpansion in project CombatLogX by SirBlobman.
the class CustomScoreboardManager method isGlobalEnabled.
private boolean isGlobalEnabled() {
ScoreboardExpansion expansion = getExpansion();
ConfigurationManager configurationManager = expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
return configuration.getBoolean("enabled", true);
}
use of combatlogx.expansion.scoreboard.ScoreboardExpansion in project CombatLogX by SirBlobman.
the class CustomScoreboardManager method updateScoreboard.
public void updateScoreboard(Player player) {
UUID uuid = player.getUniqueId();
ScoreboardExpansion expansion = getExpansion();
ScoreboardManager bukkitScoreboardManager = Bukkit.getScoreboardManager();
if (bukkitScoreboardManager == null) {
Logger logger = expansion.getLogger();
logger.warning("The Bukkit scoreboard manager is not available yet!");
return;
}
if (isDisabled(player)) {
removeScoreboard(player);
return;
}
CustomScoreboard customScoreboard = this.combatScoreboardMap.getOrDefault(uuid, null);
if (customScoreboard == null) {
createScoreboard(player);
return;
}
customScoreboard.updateScoreboard();
}
use of combatlogx.expansion.scoreboard.ScoreboardExpansion in project CombatLogX by SirBlobman.
the class CustomScoreboardManager method enableScoreboard.
private CustomScoreboard enableScoreboard(Player player) {
if (isDisabled(player)) {
return null;
}
UUID uuid = player.getUniqueId();
savePreviousScoreboard(player);
ScoreboardExpansion expansion = getExpansion();
CustomScoreboard customScoreboard = new CustomScoreboard(expansion, player);
customScoreboard.enableScoreboard();
this.combatScoreboardMap.put(uuid, customScoreboard);
return customScoreboard;
}
use of combatlogx.expansion.scoreboard.ScoreboardExpansion in project CombatLogX by SirBlobman.
the class CustomScoreboardManager method shouldIgnorePrevious.
private boolean shouldIgnorePrevious() {
ScoreboardExpansion expansion = getExpansion();
ConfigurationManager configurationManager = expansion.getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
return !configuration.getBoolean("save-previous");
}
use of combatlogx.expansion.scoreboard.ScoreboardExpansion in project CombatLogX by SirBlobman.
the class CustomScoreboard method replacePlaceholders.
private String replacePlaceholders(String string) {
ScoreboardExpansion expansion = getExpansion();
ICombatLogX plugin = expansion.getPlugin();
ICombatManager combatManager = plugin.getCombatManager();
Player player = getPlayer();
LivingEntity enemy = combatManager.getEnemy(player);
String color = MessageUtility.color(string);
return combatManager.replaceVariables(player, enemy, color);
}
Aggregations