Search in sources :

Example 1 with ScoreboardScore

use of net.minecraft.server.v1_12_R1.ScoreboardScore in project PaperDev by Kamillaova.

the class CraftScore method getScore.

public int getScore() throws IllegalStateException {
    Scoreboard board = objective.checkState().board;
    if (board.getPlayers().contains(entry)) {
        // Lazy
        Map<ScoreboardObjective, ScoreboardScore> scores = board.getPlayerObjectives(entry);
        ScoreboardScore score = scores.get(objective.getHandle());
        if (score != null) {
            // Lazy
            return score.getScore();
        }
    }
    // Lazy
    return 0;
}
Also used : Scoreboard(net.minecraft.server.v1_12_R1.Scoreboard) ScoreboardObjective(net.minecraft.server.v1_12_R1.ScoreboardObjective) ScoreboardScore(net.minecraft.server.v1_12_R1.ScoreboardScore)

Aggregations

Scoreboard (net.minecraft.server.v1_12_R1.Scoreboard)1 ScoreboardObjective (net.minecraft.server.v1_12_R1.ScoreboardObjective)1 ScoreboardScore (net.minecraft.server.v1_12_R1.ScoreboardScore)1