Java 类net.minecraft.server.Scoreboard 实例源码

项目:CraftBukkit    文件:CraftScore.java   
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
}
项目:CraftBukkit    文件:CraftScoreboard.java   
CraftScoreboard(Scoreboard board) {
    this.board = board;

    for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectives()) {
        new CraftObjective(this, objective); // It adds itself to map
    }
    for (ScoreboardTeam team : (Iterable<ScoreboardTeam>) board.getTeams()) {
        new CraftTeam(this, team); // It adds itself to map
    }
}
项目:CraftBukkit    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:CraftBukkit    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:CraftBukkit    文件:CraftScoreboardManager.java   
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;
}
项目:Craftbukkit    文件:CraftScore.java   
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
}
项目:Craftbukkit    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:Craftbukkit    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:Craftbukkit    文件:CraftScoreboardManager.java   
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;
}
项目:Almura-Server    文件:CraftScore.java   
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
}
项目:Almura-Server    文件:CraftScoreboard.java   
CraftScoreboard(Scoreboard board) {
    this.board = board;

    for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectives()) {
        new CraftObjective(this, objective); // It adds itself to map
    }
    for (ScoreboardTeam team : (Iterable<ScoreboardTeam>) board.getTeams()) {
        new CraftTeam(this, team); // It adds itself to map
    }
}
项目:Almura-Server    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:Almura-Server    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:Almura-Server    文件:CraftScoreboardManager.java   
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;
}
项目:Tweakkit-Server    文件:CraftScore.java   
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
}
项目:Tweakkit-Server    文件:CraftScoreboard.java   
CraftScoreboard(Scoreboard board) {
    this.board = board;

    for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectives()) {
        new CraftObjective(this, objective); // It adds itself to map
    }
    for (ScoreboardTeam team : (Iterable<ScoreboardTeam>) board.getTeams()) {
        new CraftTeam(this, team); // It adds itself to map
    }
}
项目:Tweakkit-Server    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:Tweakkit-Server    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:Tweakkit-Server    文件:CraftScoreboardManager.java   
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;
}
项目:SpigotSource    文件:CraftScore.java   
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
}
项目:SpigotSource    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:SpigotSource    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:SpigotSource    文件:CraftScoreboardManager.java   
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;
}
项目:Craft-city    文件:CraftScore.java   
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
}
项目:Craft-city    文件:CraftScoreboard.java   
CraftScoreboard(Scoreboard board) {
    this.board = board;

    for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectives()) {
        new CraftObjective(this, objective); // It adds itself to map
    }
    for (ScoreboardTeam team : (Iterable<ScoreboardTeam>) board.getTeams()) {
        new CraftTeam(this, team); // It adds itself to map
    }
}
项目:Craft-city    文件:CraftObjective.java   
public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            board.setDisplaySlot(i, null);
        }
    }
    if (slot != null) {
        int slotNumber = CraftScoreboardTranslations.fromBukkitSlot(slot);
        board.setDisplaySlot(slotNumber, getHandle());
    }
}
项目:Craft-city    文件:CraftObjective.java   
public DisplaySlot getDisplaySlot() throws IllegalStateException {
    CraftScoreboard scoreboard = checkState();
    Scoreboard board = scoreboard.board;
    ScoreboardObjective objective = this.objective;

    for (int i = 0; i < CraftScoreboardTranslations.MAX_DISPLAY_SLOT; i++) {
        if (board.getObjectiveForSlot(i) == objective) {
            return CraftScoreboardTranslations.toBukkitSlot(i);
        }
    }
    return null;
}
项目:Craft-city    文件:CraftScoreboardManager.java   
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;
}
项目:CraftBukkit    文件:CraftScoreboard.java   
public Scoreboard getHandle() {
    return board;
}
项目:CraftBukkit    文件:CraftScoreboardTranslations.java   
static DisplaySlot toBukkitSlot(int i) {
    return SLOTS.inverse().get(Scoreboard.getSlotName(i));
}
项目:CraftBukkit    文件:CraftScoreboardTranslations.java   
static int fromBukkitSlot(DisplaySlot slot) {
    return Scoreboard.getSlotForName(SLOTS.get(slot));
}
项目:CraftBukkit    文件:CraftScoreboardManager.java   
public CraftScoreboardManager(MinecraftServer minecraftserver, net.minecraft.server.Scoreboard scoreboardServer) {
    mainScoreboard = new CraftScoreboard(scoreboardServer);
    server = minecraftserver;
    scoreboards.add(mainScoreboard);
}
项目:Craftbukkit    文件:CraftScoreboard.java   
CraftScoreboard(Scoreboard board) {
    this.board = board;
}
项目:Craftbukkit    文件:CraftScoreboard.java   
public Scoreboard getHandle() {
    return board;
}
项目:Craftbukkit    文件:CraftScoreboardTranslations.java   
static DisplaySlot toBukkitSlot(int i) {
    return SLOTS.inverse().get(Scoreboard.getSlotName(i));
}
项目:Craftbukkit    文件:CraftScoreboardTranslations.java   
static int fromBukkitSlot(DisplaySlot slot) {
    return Scoreboard.getSlotForName(SLOTS.get(slot));
}
项目:Craftbukkit    文件:CraftScoreboardManager.java   
public CraftScoreboardManager(MinecraftServer minecraftserver, net.minecraft.server.Scoreboard scoreboardServer) {
    mainScoreboard = new CraftScoreboard(scoreboardServer);
    server = minecraftserver;
    scoreboards.add(mainScoreboard);
}
项目:Almura-Server    文件:CraftScoreboard.java   
public Scoreboard getHandle() {
    return board;
}
项目:Almura-Server    文件:CraftScoreboardTranslations.java   
static DisplaySlot toBukkitSlot(int i) {
    return SLOTS.inverse().get(Scoreboard.getSlotName(i));
}
项目:Almura-Server    文件:CraftScoreboardTranslations.java   
static int fromBukkitSlot(DisplaySlot slot) {
    return Scoreboard.getSlotForName(SLOTS.get(slot));
}