org.bukkit.craftbukkit.scoreboard.CraftScoreboard Java Examples

The following examples show how to use org.bukkit.craftbukkit.scoreboard.CraftScoreboard. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Utils.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void displayScoreboard(Player player, Objective objective) {
    ScoreboardServer server = (ScoreboardServer) ((CraftScoreboard) objective.getScoreboard()).getHandle();
    ScoreboardObjective nmsObjective = ((CraftObjective) objective).getHandle();
    List<Packet<?>> packets = server.getScoreboardScorePacketsForObjective(nmsObjective);

    for(Packet packet : packets) {
        sendPacket(player, packet);
    }

    sendPacket(player, new PacketPlayOutScoreboardDisplayObjective(1, nmsObjective));
}
 
Example #2
Source File: Utils.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void addScore(Player player, Objective objective, String name, int value) {
    ScoreboardScore score = new ScoreboardScore(((CraftScoreboard)objective.getScoreboard()).getHandle(), ((CraftObjective) objective).getHandle() , name);
    score.setScore(value);
    PacketPlayOutScoreboardScore packet = new PacketPlayOutScoreboardScore(score);

    sendPacket(player, packet);
}
 
Example #3
Source File: CraftPlayer.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public CraftScoreboard getScoreboard() {
    return this.server.getScoreboardManager().getPlayerBoard(this);
}
 
Example #4
Source File: CraftPlayer.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public CraftScoreboard getScoreboard() {
    return this.server.getScoreboardManager().getPlayerBoard(this);
}