public int getScore() throws IllegalStateException { Scoreboard board = objective.checkState().board; if (board.getPlayers().contains(entry)) { // Lazy Map<String, ScoreboardScore> scores = board.getPlayerObjectives(entry); ScoreboardScore score = scores.get(objective.getHandle()); if (score != null) { // Lazy return score.getScore(); } } return 0; // Lazy }
public Collection<ScoreboardScore> getScoreboardScores(IScoreboardCriteria criteria, String name, Collection<ScoreboardScore> collection) { for (CraftScoreboard scoreboard : scoreboards) { Scoreboard board = scoreboard.board; for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectivesForCriteria(criteria)) { collection.add(board.getPlayerScoreForObjective(name, objective)); } } return collection; }
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(); } } return 0; // Lazy }
public int getScore() throws IllegalStateException { Scoreboard board = objective.checkState().board; if (board.getPlayers().contains(playerName)) { // Lazy Map<String, ScoreboardScore> scores = board.getPlayerObjectives(playerName); ScoreboardScore score = scores.get(objective.getHandle()); if (score != null) { // Lazy return score.getScore(); } } return 0; // Lazy }
public void reset() throws IllegalStateException { CraftScoreboard myBoard = objective.checkState(); Map<ScoreboardObjective, ScoreboardScore> savedScores = myBoard.board.getPlayerObjectives(playerName); if (savedScores.remove(objective.getHandle()) == null) { // If they don't have a score to delete, don't delete it. return; } myBoard.board.resetPlayerScores(playerName); for (Map.Entry<ScoreboardObjective, ScoreboardScore> e : savedScores.entrySet()) { myBoard.board.getPlayerScoreForObjective(playerName, e.getKey()).setScore(e.getValue().getScore()); } }
public int getScore() throws IllegalStateException { Scoreboard board = objective.checkState().board; if (board.getPlayers().contains(entry)) { // Lazy Map<net.minecraft.server.ScoreboardObjective, ScoreboardScore> scores = board.getPlayerObjectives(entry); // Spigot ScoreboardScore score = scores.get(objective.getHandle()); if (score != null) { // Lazy return score.getScore(); } } return 0; // Lazy }
public void updateAllScoresForList(IScoreboardCriteria criteria, String name, List<EntityPlayer> of) { for (ScoreboardScore score : getScoreboardScores(criteria, name, new ArrayList<ScoreboardScore>())) { score.updateForList(of); } }
public void updateAllScoresForList(IScoreboardCriteria criteria, String name, List<EntityPlayer> of) { for (ScoreboardScore score : getScoreboardScores(criteria, name, new ArrayList<ScoreboardScore>())) { score.updateForList((List) of); } }