use of org.bukkit.scoreboard.Scoreboard in project GameCore by Warvale.
the class LobbyScoreboard method addScoreboard.
public void addScoreboard(Player player, String display) {
Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("lobby", "dummy");
objective.setDisplayName(ChatColor.DARK_GRAY + "» " + display + ChatColor.DARK_GRAY + " «");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
Team time = scoreboard.registerNewTeam("LobbyTime");
time.addEntry("§8» §cTime:");
time.setSuffix(" §7");
Team lobbyCount = scoreboard.registerNewTeam("LobbyCount");
lobbyCount.addEntry("§8» §cPlayers:");
lobbyCount.setSuffix(" §7");
scoreboards.put(player.getUniqueId(), scoreboard);
}
use of org.bukkit.scoreboard.Scoreboard in project MassiveCore by MassiveCraft.
the class BoardUtil method ensureBoard.
// -------------------------------------------- //
// ENSURE
// -------------------------------------------- //
public static Scoreboard ensureBoard(Player player, boolean strict) {
Scoreboard board = getBoard(player);
if (isBoardOur(board))
return board;
if (!strict && !isBoardMain(board))
return board;
board = getBoardOur();
setBoard(player, board);
return board;
}
use of org.bukkit.scoreboard.Scoreboard in project MassiveCore by MassiveCraft.
the class BoardUtil method updateEnsure.
public static void updateEnsure() {
EventMassiveCoreBoardEnsure event = new EventMassiveCoreBoardEnsure();
event.run();
for (Player player : getPlayers().values()) {
if (event.isEnsureBoardEnabled()) {
ensureBoard(player, event.isEnsureBoardStrict());
}
if (event.isEnsureTeamEnabled()) {
for (Scoreboard board : getBoards()) {
ensureTeam(board, player, event.isEnsureTeamStrict());
}
}
}
}
use of org.bukkit.scoreboard.Scoreboard in project MassiveCore by MassiveCraft.
the class BoardUtil method updateBoards.
public static void updateBoards() {
// Create
Set<Scoreboard> boards = new MassiveSet<>();
// Fill > Simple
boards.add(getBoardMain());
boards.add(getBoardOur());
// Fill > Players
for (Player player : getPlayers().values()) {
Scoreboard board = getBoard(player);
boards.add(board);
}
// Set
boards = Collections.unmodifiableSet(boards);
BoardUtil.boards = boards;
}
use of org.bukkit.scoreboard.Scoreboard in project MassiveCore by MassiveCraft.
the class NmsBoard17R4 method getBoardHandleValidated.
protected <T> T getBoardHandleValidated(Team team) {
Scoreboard board = team.getScoreboard();
T handle = NmsBasics.get().getHandle(board);
if (ReflectionUtil.invokeMethod(this.methodNmsScoreboardGetTeam, handle, team.getName()) == null)
throw new IllegalStateException("Unregistered scoreboard component");
return handle;
}
Aggregations