Search in sources :

Example 21 with Scoreboard

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);
}
Also used : Objective(org.bukkit.scoreboard.Objective) Scoreboard(org.bukkit.scoreboard.Scoreboard) Team(org.bukkit.scoreboard.Team)

Example 22 with 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;
}
Also used : Scoreboard(org.bukkit.scoreboard.Scoreboard)

Example 23 with Scoreboard

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());
            }
        }
    }
}
Also used : Player(org.bukkit.entity.Player) Scoreboard(org.bukkit.scoreboard.Scoreboard) EventMassiveCoreBoardEnsure(com.massivecraft.massivecore.event.EventMassiveCoreBoardEnsure)

Example 24 with Scoreboard

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;
}
Also used : Player(org.bukkit.entity.Player) Scoreboard(org.bukkit.scoreboard.Scoreboard) MassiveSet(com.massivecraft.massivecore.collections.MassiveSet)

Example 25 with Scoreboard

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;
}
Also used : Scoreboard(org.bukkit.scoreboard.Scoreboard)

Aggregations

Scoreboard (org.bukkit.scoreboard.Scoreboard)39 Team (org.bukkit.scoreboard.Team)24 GameProfile (com.mojang.authlib.GameProfile)11 UUID (java.util.UUID)11 Objective (org.bukkit.scoreboard.Objective)11 Property (com.mojang.authlib.properties.Property)7 BigInteger (java.math.BigInteger)7 MessageDigest (java.security.MessageDigest)7 Player (org.bukkit.entity.Player)7 PlayerProfile (net.aufdemrand.denizen.nms.util.PlayerProfile)4 PlayerProfile (com.denizenscript.denizen.nms.util.PlayerProfile)3 File (java.io.File)3 Skin (net.citizensnpcs.npc.skin.Skin)3 User (net.dzikoysk.funnyguilds.basic.User)3 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)3 EntityType (org.bukkit.entity.EntityType)3 PotionEffectType (org.bukkit.potion.PotionEffectType)3 PotionType (org.bukkit.potion.PotionType)3 Score (org.bukkit.scoreboard.Score)3 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)2