Java 类org.bukkit.scoreboard.ScoreboardManager 实例源码

项目:MT_Core    文件:CustomScoreboards.java   
public CustomScoreboards(MortuusTerraCore main) {
    this.main = main;
    ScoreboardManager manager = Bukkit.getScoreboardManager();

    pkTeamsBoard = manager.getNewScoreboard();

    pkTeamsBoard.registerNewTeam("NEUTRAL");
    pkTeamsBoard.registerNewTeam("ORANGE");
    pkTeamsBoard.registerNewTeam("RED");

    pkTeamsBoard.getTeam("NEUTRAL").setPrefix(PKStates.NEUTRAL.getColor() + "");
    pkTeamsBoard.getTeam("ORANGE").setPrefix(PKStates.ORANGE.getColor() + "");
    pkTeamsBoard.getTeam("RED").setPrefix(PKStates.RED.getColor() + "");

    for (Team team : pkTeamsBoard.getTeams()) {
        team.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.ALWAYS);
    }
}
项目:CubeKrowd-Icerunner    文件:Scoreboardmanager.java   
public void create(){
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    board = manager.getNewScoreboard();
    teamRed = board.registerNewTeam("Red");
    teamRed.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
    teamRed.setAllowFriendlyFire(false);
    teamGreen = board.registerNewTeam("Green");
    teamGreen.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
    teamGreen.setAllowFriendlyFire(false);
    objective = board.registerNewObjective("time", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName("Time");
    Score scoreRed = objective.getScore(ChatColor.RED + "Red:");
    scoreRed.setScore(Game.getGame().getCurrentArena().maxPoints);
    Score scoreGreen = objective.getScore(ChatColor.GREEN + "Green:");
    scoreGreen.setScore(Game.getGame().getCurrentArena().maxPoints);
    teamRed.setPrefix(ChatColor.RED.toString());
    teamGreen.setPrefix(ChatColor.GREEN.toString());
    teamRed.setSuffix(ChatColor.WHITE.toString());
    teamGreen.setSuffix(ChatColor.WHITE.toString());
}
项目:gFeatures    文件:GlidersScore.java   
public Scoreboard Initialize(Player p) throws IllegalStateException, IllegalArgumentException{
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "     _Esti" + ChatColor.DARK_AQUA + "" + ChatColor.BOLD +"Net_     ");
    Score score2 = objective.getScore(ChatColor.DARK_BLUE + "Online:"); //Get a fake offline player
    score2.setScore(12);
    Score score3 = objective.getScore(ChatColor.BOLD + "" + Integer.toString(Bukkit.getServer().getOnlinePlayers().size())); //Get a fake offline player
    score3.setScore(11);
    Score score7 = objective.getScore(ChatColor.GREEN + "Time left:"); //Get a fake offline player
    score7.setScore(10);
    Score score10 = objective.getScore(ChatColor.BOLD + "" + Basic.minutes + "m " + Basic.seconds + "s"); //Get a fake offline player
    score10.setScore(9);
    Score score = objective.getScore(ChatColor.AQUA + "Kills:"); //Get a fake offline player
    score.setScore(8);
    Score score5 = objective.getScore(ChatColor.BOLD + "" + Basic.kills.get(p.getUniqueId()) + " "); //Get a fake offline player
    score5.setScore(7);
    Score score8 = objective.getScore(ChatColor.GOLD + "Deaths:");
    score8.setScore(6);
    Score score9 = objective.getScore(ChatColor.BOLD + "" + Basic.deaths.get(p.getUniqueId()) + " ");
    score9.setScore(5);
    return board;
}
项目:gFeatures    文件:Lobby.java   
public Scoreboard Initialize(Player p) throws IllegalStateException, IllegalArgumentException{
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "     _Esti" + ChatColor.DARK_AQUA + "" + ChatColor.BOLD +"Net_     ");
    Score score2 = objective.getScore(ChatColor.DARK_BLUE + "Online:"); //Get a fake offline player
    score2.setScore(4);
    Score score3 = objective.getScore(ChatColor.BOLD + "" + Integer.toString(Bukkit.getServer().getOnlinePlayers().size())); //Get a fake offline player
    score3.setScore(3);
    Score score = objective.getScore(ChatColor.AQUA + "Time before game starts:"); //Get a fake offline player
    score.setScore(2);
    Score score5 = objective.getScore(ChatColor.BOLD + "" + Basic.countdown + " "); //Get a fake offline player
    score5.setScore(1);
    return board;
}
项目:gFeatures    文件:Lobby.java   
public Scoreboard Initialize(Player p) throws IllegalStateException, IllegalArgumentException{
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "     _Esti" + ChatColor.DARK_AQUA + "" + ChatColor.BOLD +"Net_     ");
    Score score2 = objective.getScore(ChatColor.DARK_BLUE + "Online:"); //Get a fake offline player
    score2.setScore(4);
    Score score3 = objective.getScore(ChatColor.BOLD + "" + Integer.toString(Bukkit.getServer().getOnlinePlayers().size())); //Get a fake offline player
    score3.setScore(3);
    Score score = objective.getScore(ChatColor.AQUA + "Time before game starts:"); //Get a fake offline player
    score.setScore(2);
    Score score5 = objective.getScore(ChatColor.BOLD + "" + Basic.countdown + " "); //Get a fake offline player
    score5.setScore(1);
    return board;
}
项目:acidisland    文件:IslandGuard1_9.java   
public IslandGuard1_9(final ASkyBlock plugin) {
    this.plugin = plugin;
    this.thrownPotions = new HashMap<Integer, UUID>();
    if (!Settings.allowPushing) {
        // try to remove the team from the scoreboard
        try {
            ScoreboardManager manager = plugin.getServer().getScoreboardManager();
            if (manager != null) {
                Scoreboard scoreboard = manager.getMainScoreboard();
                if (scoreboard != null) {
                    Team pTeam = scoreboard.getTeam(NO_PUSH_TEAM_NAME);
                    if (pTeam != null) {
                        pTeam.unregister();
                    }
                }
            }
        } catch (Exception e) {
            plugin.getLogger().warning("Problem removing no push from scoreboard.");
        }
    }
}
项目:askyblock    文件:IslandGuard1_9.java   
public IslandGuard1_9(final ASkyBlock plugin) {
    this.plugin = plugin;
    this.thrownPotions = new HashMap<Integer, UUID>();
    if (!Settings.allowPushing) {
        // try to remove the team from the scoreboard
        try {
            ScoreboardManager manager = plugin.getServer().getScoreboardManager();
            if (manager != null) {
                Scoreboard scoreboard = manager.getMainScoreboard();
                if (scoreboard != null) {
                    Team pTeam = scoreboard.getTeam(NO_PUSH_TEAM_NAME);
                    if (pTeam != null) {
                        pTeam.unregister();
                    }
                }
            }
        } catch (Exception e) {
            plugin.getLogger().warning("Problem removing no push from scoreboard.");
        }
    }
}
项目:Pugna    文件:Stats.java   
public void setBountyBoard(Player player, Player contractor, Reward reward)
{
    ScoreboardManager mang = Bukkit.getScoreboardManager();
    Scoreboard board = mang.getNewScoreboard();

    Objective objective = board.registerNewObjective("Stats", "dummy");

    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.BLUE +  "Bounty");

    Score bounty = objective.getScore(Bukkit.getOfflinePlayer("Bounty For You"));
    Score cont = objective.getScore(Bukkit.getOfflinePlayer("From: " + contractor.getPlayerListName())); //might be too long
    Score value = objective.getScore(Bukkit.getOfflinePlayer("Reward: " + reward.getItem()));

    bounty.setScore(1 + reward.getAmount());
    cont.setScore(1);
    value.setScore(reward.getAmount());

    player.setScoreboard(board);
    scoreTimer(player);
}
项目:Pugna    文件:Stats.java   
public void setPlayerBoard(Player player)
{
    ScoreboardManager mang = Bukkit.getScoreboardManager();
    Scoreboard board = mang.getNewScoreboard();

    Objective objective = board.registerNewObjective("Stats", "dummy");

    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.BLUE +  "Your Stats");

    Score score = objective.getScore(Bukkit.getOfflinePlayer("Score: "));
    Score kills = objective.getScore(Bukkit.getOfflinePlayer("Kills: " ));
    Score deaths = objective.getScore(Bukkit.getOfflinePlayer("Deaths: " ));
    Score teamRank = objective.getScore(Bukkit.getOfflinePlayer("Team Rank: "));

    PugnaPlayer play = pg.track.getPlayerData(player);
    PugnaScore values = play.getScore();

    score.setScore(values.getTotalScore());
    kills.setScore(values.getKills());
    deaths.setScore(values.getDeaths());

    player.setScoreboard(board);
    scoreTimer(player);
}
项目:SkyWarsReloaded    文件:Game.java   
private void getScoreBoard() {
    if (scoreboard != null) {
           resetScoreboard();
       }
    ScoreboardManager manager = SkyWarsReloaded.get().getServer().getScoreboardManager();
    scoreboard = manager.getNewScoreboard();
       objective = scoreboard.registerNewObjective("info", "dummy");
       objective.setDisplaySlot(DisplaySlot.SIDEBAR);
       String leaderboard = new Messaging.MessageFormatter().setVariable("mapname", mapName.toUpperCase()).format("game.scoreboard-title");
       objective.setDisplayName(leaderboard);
}
项目:OldBukkit    文件:Main.java   
public void onEnable() {

    ScoreboardManager manager = Bukkit.getScoreboardManager();
    board = manager.getNewScoreboard();

    final Objective objective = board.registerNewObjective("test1", "teste2");
    objective.setDisplayName("");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);

    gue = board.registerNewTeam("gue");
    gue.setPrefix(ChatColor.DARK_AQUA + "[Guerreiro] " + ChatColor.RESET);

    Main.instance = this;
    data.setup(this);
    saveDefaultConfig();
    Hooks.hookEconomy();
    Hooks.hookChat();
    Hooks.hookSimpleClans();
    Utils.scoreBoard();
    Utils.atualizarTag();

    if (Bukkit.getPluginManager().getPlugin("Legendchat") == null) {
      getServer().getConsoleSender().sendMessage("§4[LsGuerreiro] §cLegendChat nao encontrado, tag desativada.");
    }

    getServer().getConsoleSender().sendMessage("§3[LsGuerreiro]§b Plugin habilitado com sucesso.");
    getServer().getConsoleSender().sendMessage("§3[LsGuerreiro]§b Plugin criado por DevLeeo!");
    getServer().getConsoleSender().sendMessage("§3[LsGuerreiro]§b Versao: " + getDescription().getVersion());

    getCommand("guerreiro").setExecutor(new Comandos());
    getServer().getPluginManager().registerEvents(new Eventos(), this);
  }
项目:gFeatures    文件:Scored.java   
public static Scoreboard getScore(Player p) throws IllegalStateException, IllegalArgumentException{
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "     Esti" + ChatColor.DARK_AQUA + "" + ChatColor.BOLD +"Net     ");
    Score score1 = objective.getScore("");
    score1.setScore(11);
    Score score2 = objective.getScore(ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Online");
    score2.setScore(10);
    Score score3 = objective.getScore(ChatColor.GRAY + "" + ServerQuery.getPlayerCount());
    score3.setScore(9);
    Score score12 = objective.getScore(" ");
    score12.setScore(8);
    Score score = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "Coins ⛀⛁⛃⛂");
    score.setScore(7);
    Score score5 = objective.getScore(ChatColor.GRAY + "" + EstiCoins.getMoney(p));
    score5.setScore(6);
    Score score11 = objective.getScore("  ");
    score11.setScore(5);
    Score score8 = objective.getScore(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Random Word");
    score8.setScore(4);
    String[] str = {"Awesome!", "Epic!", "Amazing!", "Cool!", "I caz spll", "Dude!", "EstiNet!", "Hi!", "Different!", "Oink." , "Beep!", "Welcome!", "Yo.", "LOL!", "wut", "Play!", "toes"};
    Score score9 = objective.getScore(ChatColor.GRAY + str[(int) Math.floor(Math.random() * 17)]);
    score9.setScore(3);
    Score score100 = objective.getScore("   ");
    score100.setScore(2);
    if(!(p.getName().length() >= 16)){
        Score score10 = objective.getScore(ChatColor.DARK_AQUA + p.getName().trim());
        score10.setScore(1);
    }
    return board;
}
项目:gFeatures    文件:ScoreboardCreator.java   
public static Scoreboard getScoreboard(int seconds){
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GRAY + "(⌐■_■) Time Left: " + ChatColor.DARK_AQUA + seconds);
    Object[] doo = ParkourRace.distances.keySet().toArray();
    Arrays.sort(doo);
    for(int i = 0; i < doo.length; i++){
        Score score = objective.getScore(Bukkit.getPlayer(ParkourRace.distances.get(doo[i])).getName());
        score.setScore((int) (double) doo[i]);
    }
    return board;
}
项目:gFeatures    文件:ScoreboardCreator.java   
public static Scoreboard getScoreboard(int seconds){
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.GRAY + "(⌐■_■) Time Left: " + ChatColor.DARK_AQUA + seconds);
    Score score = objective.getScore("Players left: " + Spleef.stillIn.size());
    score.setScore(1);
    return board;
}
项目:gFeatures    文件:Countdown.java   
public Scoreboard get(Player p, int count) throws IllegalStateException, IllegalArgumentException{
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("test", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName("[" + ChatColor.GREEN + "" + ChatColor.BOLD + "Grasslands" + ChatColor.RESET +"]");
    Score score1 = objective.getScore(""); //Get a fake offline player
    score1.setScore(10);
    Score score2 = objective.getScore(ChatColor.DARK_BLUE + "" + ChatColor.BOLD + "Online:"); //Get a fake offline player
    score2.setScore(9);
    Score score3 = objective.getScore("" + Integer.toString(Bukkit.getServer().getOnlinePlayers().size())); //Get a fake offline player
    score3.setScore(8);
    Score score11 = objective.getScore(""); //Get a fake offline player
    score11.setScore(7);
    Score score = objective.getScore(ChatColor.GREEN + "Clupic:"); //Get a fake offline player
    score.setScore(6);
    Score score5 = objective.getScore("" + Double.toString(EstiCoins.getMoney(p))); //Get a fake offline player
    score5.setScore(5);
    Score score12 = objective.getScore(""); //Get a fake offline player
    score12.setScore(4);
    Score score8 = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD +  "Countdown:");
    score8.setScore(3);
    Score score9 = objective.getScore("" + count);
    score9.setScore(2);
    if(!(p.getName().length() >= 16)){
    Score score10 = objective.getScore(ChatColor.DARK_AQUA + p.getName().trim());
    score10.setScore(1);
    }
    return board;
}
项目:COD-Warfare    文件:Main.java   
@SuppressWarnings("deprecation")
public static void createLobbyBoard(Player p){
      ScoreboardManager manager = Bukkit.getScoreboardManager();
      Scoreboard board = manager.getNewScoreboard();

      Objective objective = board.registerNewObjective("LobbyBoard", "dummy");

      objective.setDisplaySlot(DisplaySlot.SIDEBAR);
      objective.setDisplayName("§4§lYour Scores");

      Score Level = objective.getScore(Bukkit.getOfflinePlayer("§b§lLevel:"));
      Score Credits = objective.getScore(Bukkit.getOfflinePlayer("§b§lCredits:"));
      Score LobbyKills = objective.getScore(Bukkit.getOfflinePlayer("§b§lKills:"));
      Score LobbyDeaths = objective.getScore(Bukkit.getOfflinePlayer("§b§lDeaths:"));
      Score highestKS = objective.getScore(Bukkit.getOfflinePlayer("§bhes§lHigest Kill Streak:"));

      Level.setScore(1);
      Credits.setScore(0);
      LobbyKills.setScore(0);
      LobbyDeaths.setScore(0);
      highestKS.setScore(0);

      if (LobbyLevelScore.get(p.getName()) == null) LobbyLevelScore.put(p.getName(), Level);
      if (LobbyCreditsScore.get(p.getName()) == null) LobbyCreditsScore.put(p.getName(), Credits);
      if (LobbyKillsScore.get(p.getName()) == null) LobbyKillsScore.put(p.getName(), LobbyKills);
      if (LobbyDeathsScore.get(p.getName()) == null) LobbyDeathsScore.put(p.getName(), LobbyDeaths);
      if (highestKillstreak.get(p.getName()) == null) highestKillstreak.put(p.getName(), highestKS);

      if (LobbyScoreboard.get(p.getName()) == null) LobbyScoreboard.put(p.getName(), board);

  }
项目:COD-Warfare    文件:Main.java   
@SuppressWarnings("deprecation")
public static void createGameBoard(final Player p){
      final ScoreboardManager manager = Bukkit.getScoreboardManager();

      Bukkit.getServer().getScheduler().runTask(ThisPlugin.getPlugin(), new Runnable() {
            @Override
            public void run() {
                Scoreboard board = manager.getNewScoreboard();

                Objective objective = board.registerNewObjective("GameBoard", "dummy");

                objective.setDisplaySlot(DisplaySlot.SIDEBAR);
                objective.setDisplayName("§4§lYour Scores");

                Score Level = objective.getScore(Bukkit.getOfflinePlayer("§b§lLevel:"));
                Score Credits = objective.getScore(Bukkit.getOfflinePlayer("§b§lCredits:"));
                Score GameKills = objective.getScore(Bukkit.getOfflinePlayer("§b§lKills:"));
                Score GameDeaths = objective.getScore(Bukkit.getOfflinePlayer("§b§lDeaths:"));
                Score KillStreak = objective.getScore(Bukkit.getOfflinePlayer("§b§lKill Streak:"));

                Level.setScore(1);
                Credits.setScore(0);
                GameKills.setScore(0);
                GameDeaths.setScore(0);
                KillStreak.setScore(0);

                if (GameLevelScore.get(p.getName()) == null) GameLevelScore.put(p.getName(), Level);
                if (GameCreditsScore.get(p.getName()) == null) GameCreditsScore.put(p.getName(), Credits);
                if (GameKillsScore.get(p.getName()) == null) GameKillsScore.put(p.getName(), GameKills);
                if (GameDeathsScore.get(p.getName()) == null) GameDeathsScore.put(p.getName(), GameDeaths);
                if (GameKillStreakScore.get(p.getName()) == null) GameKillStreakScore.put(p.getName(), KillStreak);

                if (GameScoreboard.get(p.getName()) == null) GameScoreboard.put(p.getName(), board);
            }
        });
  }
项目:SurvivalGamesX    文件:GameManager.java   
public GameManager(SurvivalGames plugin) {
    this.plugin = plugin;
    this.arenaMan = plugin.getArenaManager();
    this.statMan = plugin.getStatManager();
    taskMan = plugin.getTaskManager();
    tributes = new ArrayList<String>();
    vanished = new ArrayList<Player>();
    killedPlayers = new ArrayList<String>();
    spectators = new ArrayList<String>();
    damagecause = new HashMap<String, PlayerDamage>();
    spectatorWatching = new HashMap<String, Integer>();
    grace = new ArrayList<String>();
    playerGames = new HashMap<String, Integer>();

    nextGame = System.currentTimeMillis() + (arenaMan.getLobby().gameTime * 1000);

    name = plugin.getServer().getClass().getPackage().getName();
    version = name.substring(name.lastIndexOf('.') + 1);

    schedulePeriodTasks();

    if(plugin.getSettings().enableScoreboard) {
        ScoreboardManager boardManager = plugin.getServer().getScoreboardManager();

        lobbyScoreboard = boardManager.getNewScoreboard();
        lobbyScoreboard.registerNewObjective("lobby", "dummy");

        gameScoreboard = boardManager.getNewScoreboard();
        gameScoreboard.registerNewObjective("game", "dummy");
        gameScoreboard.registerNewObjective("bounty", "dummy");

        if(!arenaMan.arenaOrder.isEmpty())
            updateScoreBoards();
    }
}
项目:AceOfSpadesMiniGame    文件:PlayersStatsboard.java   
public static void NewStats(Player p) throws Exception{
 p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
  ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard  board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("Statystyki","dummy");
    objective.setDisplayName("Info");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    Score score = objective.getScore(Bukkit.getOfflinePlayer("§6Naboje"));
    score.setScore(2000);
    p.setScoreboard(board);
}
项目:skRayFall    文件:Core.java   
/**
 * Generates a new private scoreboard for the player when they join the server if
 * enableFastScoreboards is set to true.
 * 
 *
 * @param evt The Player Join Event
 */
@EventHandler
public void onJoinScoreboards(PlayerJoinEvent evt) {
  if (enableFastScoreboards == true) {
    Player player = evt.getPlayer();
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    player.setScoreboard(board);
  }
}
项目:Pugna    文件:Stats.java   
public void setTeamBoard(Player player, PugnaTeam team)
{
    ScoreboardManager mang = Bukkit.getScoreboardManager();
    Scoreboard board = mang.getNewScoreboard();

    Objective objective = board.registerNewObjective("Stats", "dummy");

    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.BLUE +  "Team Stats");
}
项目:Pugna    文件:Stats.java   
public void removeBoard(Player player)
{
    ScoreboardManager manger = Bukkit.getScoreboardManager();
    Scoreboard board = manger.getNewScoreboard();

    player.setScoreboard(board);
}
项目:Bytecraft    文件:ScoreboardClearTask.java   
@Override
public void run()
{
    if (!player.isOnline()) {
        return;
    }

    try {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        player.setScoreboard(manager.getNewScoreboard());
    } catch (IllegalStateException e) {
        // We don't really care
    }
}
项目:AdminBar    文件:AdminBar.java   
public void onEnable() {
    ScoreboardManager sbm = Bukkit.getServer().getScoreboardManager();
    sb = sbm.getNewScoreboard();
    adminbar = sb.registerNewObjective("adminBar", "dummy");
    adminbar.setDisplayName(ChatColor.YELLOW + "Admin Bar");
    adminbar.setDisplaySlot(DisplaySlot.SIDEBAR);
    task = new UpdateScoreboard().runTaskTimer(this, 0, 20); // Update scoreboard every second
    this.getServer().getPluginManager().registerEvents(new AdminListener(), this);
    for (Player pl : Bukkit.getOnlinePlayers()) {
        if (pl.hasPermission("adminbar.view")) {
            pl.setScoreboard(sb);
        }
    }
}
项目:ShankShock-Core    文件:SilverScoreboard.java   
private void storeBoard(final String player) {
       plugin.getServer().getScheduler().runTask(plugin, new Runnable() {
           @Override
           public void run() {
               ScoreboardManager sb = plugin.getServer().getScoreboardManager();
               Scoreboard board = sb.getNewScoreboard();
               Objective obj = board.registerNewObjective("silver", "dummy");

               obj.setDisplaySlot(DisplaySlot.SIDEBAR);
               obj.setDisplayName(ChatColor.AQUA + "Shank" + ChatColor.DARK_GRAY + "Shock");

               scoreboards.put(player, board);
           }
       });
}
项目:tregmine    文件:ScoreboardClearTask.java   
@Override
public void run()
{
    if (!player.isOnline()) {
        return;
    }

    try {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        player.setScoreboard(manager.getNewScoreboard());
    } catch (IllegalStateException e) {
        // We don't really care
    }
}
项目:Blueprint-A-Bukkit-Plugin    文件:ScoreBoardSystem.java   
public static void addPlayer(Player player, Player player2) {
    if (player2 == null) {
        player2 = players.get(player) == null ? player : players.get(player);
    }
    players.put(player, player2);
    final String playerId = ConfigHandler.getDefaultBukkitConfig().getBoolean("use.UUIDs", true) ? player2.getUniqueId().toString() : player2.getPlayer().getName();
    List<ItemStack> blueprint = Commands.sortItemStack(DataHandler.getBlueprintItemTypes(playerId));
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();

    Objective objective = board.registerNewObjective(("materialsneeded" + playerId).substring(0, 16), "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName("Materials Needed:");
    int count = 1;
    for (ItemStack data : blueprint) {
        Score score;
        if (count++ < 16) {
            if (ItemResolver.getName(new ItemTemp(data)).length() > 16) {
                score = objective.getScore(Bukkit.getOfflinePlayer(ItemResolver.getName(new ItemTemp(data)).substring(0, 12) + "..."));
            } else {
                score = objective.getScore(Bukkit.getOfflinePlayer(ItemResolver.getName(new ItemTemp(data))));
            }
            score.setScore(data.getAmount());
        }
    }
    player.setScoreboard(board);
    if (count > 15) {
        player.sendMessage("To many blocks to list in scoreboard");
    }
    if (blueprint.size() <= 0) {
        player.sendMessage((player == player2) ? "You don't need any matterials" : player2.getDisplayName() + " doesn't need any matterials");
    }
}
项目:ProjectAres    文件:ScoreboardMatchModule.java   
@Inject ScoreboardMatchModule(ScoreboardManager scoreboardManager, SettingCallbackManager settingCallbackManager) {
    this.hiddenScoreboard = scoreboardManager.getNewScoreboard();
    this.settingCallbackManager = settingCallbackManager;
}
项目:MockBukkit    文件:ServerMock.java   
@Override
public ScoreboardManager getScoreboardManager()
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:FlexMC    文件:FlexServerImpl.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return this.scoreboardManager;
}
项目:Bukkit2Sponge    文件:FakeServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return null; // TODO: Create manager linked with Sponge.
}
项目:netherrack    文件:NetherServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    // TODO Auto-generated method stub
    return null;
}
项目:Karus-Commons    文件:StubServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
项目:Thermos-Bukkit    文件:Bukkit.java   
/**
 * @see Server#getScoreboardManager()
 */
public static ScoreboardManager getScoreboardManager() {
    return server.getScoreboardManager();
}
项目:Brynhildr    文件:NukkitServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return null;
}
项目:CraftPlugins    文件:HudGiver.java   
public ScoreboardManager getManager() {
    return manager;
}
项目:CraftPlugins    文件:HudGiver.java   
public void setManager(ScoreboardManager manager) {
    this.manager = manager;
}
项目:ExilePearl    文件:TestServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return null;
}
项目:SaneEconomy    文件:MockServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return null;
}
项目:Pokkit    文件:CraftServer.java   
@Override
public ScoreboardManager getScoreboardManager() {
    return scoreboardManager;
}