Search in sources :

Example 1 with ScoreboardHandler

use of com.github.sirblobman.api.nms.scoreboard.ScoreboardHandler 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);
}
Also used : Player(org.bukkit.entity.Player) MultiVersionHandler(com.github.sirblobman.api.nms.MultiVersionHandler) ScoreboardHandler(com.github.sirblobman.api.nms.scoreboard.ScoreboardHandler) Scoreboard(org.bukkit.scoreboard.Scoreboard) LanguageManager(com.github.sirblobman.api.language.LanguageManager) ICombatLogX(com.github.sirblobman.combatlogx.api.ICombatLogX)

Aggregations

LanguageManager (com.github.sirblobman.api.language.LanguageManager)1 MultiVersionHandler (com.github.sirblobman.api.nms.MultiVersionHandler)1 ScoreboardHandler (com.github.sirblobman.api.nms.scoreboard.ScoreboardHandler)1 ICombatLogX (com.github.sirblobman.combatlogx.api.ICombatLogX)1 Player (org.bukkit.entity.Player)1 Scoreboard (org.bukkit.scoreboard.Scoreboard)1