org.bukkit.scoreboard.ScoreboardManager Java Examples

The following examples show how to use org.bukkit.scoreboard.ScoreboardManager. 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: IslandGuard1_9.java    From askyblock with GNU General Public License v2.0 6 votes vote down vote up
public IslandGuard1_9(final ASkyBlock plugin) {
    this.plugin = plugin;
    this.thrownPotions = new HashMap<>();
    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.");
        }
    }
}
 
Example #2
Source File: Game.java    From Survival-Games with GNU General Public License v3.0 5 votes vote down vote up
public void Scoreboard(Player player) {
       ScoreboardManager manager = Bukkit.getScoreboardManager();
       Scoreboard board = manager.getNewScoreboard();
       
       Objective objective = board.registerNewObjective("test", "dummy");
       objective.setDisplaySlot(DisplaySlot.SIDEBAR);
       objective.setDisplayName("Scoreboard");
       objective.getName();
       
       Score score = objective.getScore(ChatColor.GREEN + "Kills:"); //Get a fake offline player
       score.setScore(1);
}
 
Example #3
Source File: PlayerStat.java    From SkyWarsReloaded with GNU General Public License v3.0 5 votes vote down vote up
private static void getScoreboard(Player player) {
	Scoreboard scoreboard = scoreboards.get(player);
	if (scoreboard != null) {
           resetScoreboard(player);
       }
	ScoreboardManager manager = SkyWarsReloaded.get().getServer().getScoreboardManager();
	scoreboard = manager.getNewScoreboard();
       Objective objective = SkyWarsReloaded.getNMS().getNewObjective(scoreboard, "dummy", "info");
       objective.setDisplaySlot(DisplaySlot.SIDEBAR);
       scoreboards.put(player, scoreboard);
	updateScoreboard(player);
}
 
Example #4
Source File: PlayerStat.java    From SkyWarsReloaded with GNU General Public License v3.0 5 votes vote down vote up
public static void getScoreboard(Player player) {
	Scoreboard scoreboard = scoreboards.get(player);
	if (scoreboard != null) {
           resetScoreboard(player);
       }
	ScoreboardManager manager = SkyWarsReloaded.get().getServer().getScoreboardManager();
	scoreboard = manager.getNewScoreboard();
       Objective objective = scoreboard.registerNewObjective("info", "dummy");
       objective.setDisplaySlot(DisplaySlot.SIDEBAR);
       scoreboards.put(player, scoreboard);
	updateScoreboard(player);
}
 
Example #5
Source File: Core.java    From skRayFall with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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) {
        Player player = evt.getPlayer();
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        player.setScoreboard(board);
    }
}
 
Example #6
Source File: ScoreboardMatchModule.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
@Inject ScoreboardMatchModule(ScoreboardManager scoreboardManager, SettingCallbackManager settingCallbackManager) {
    this.hiddenScoreboard = scoreboardManager.getNewScoreboard();
    this.settingCallbackManager = settingCallbackManager;
}
 
Example #7
Source File: MockServer.java    From Chimera with MIT License 4 votes vote down vote up
@Override
public ScoreboardManager getScoreboardManager() {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
Example #8
Source File: MockServer.java    From SaneEconomy with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ScoreboardManager getScoreboardManager() {
    return null;
}
 
Example #9
Source File: BedwarsRel.java    From BedwarsRel with GNU General Public License v3.0 4 votes vote down vote up
public ScoreboardManager getScoreboardManager() {
  return this.scoreboardManager;
}
 
Example #10
Source File: TeamManager.java    From skRayFall with GNU General Public License v3.0 4 votes vote down vote up
public TeamManager() {
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    teamBoard = manager.getNewScoreboard();
}
 
Example #11
Source File: Scoreboards.java    From askyblock with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 
 */
private Scoreboards() {
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    board = manager.getNewScoreboard();
}
 
Example #12
Source File: Server.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets the instance of the scoreboard manager.
 * <p>
 * This will only exist after the first world has loaded.
 *
 * @return the scoreboard manager or null if no worlds are loaded.
 */
ScoreboardManager getScoreboardManager();
 
Example #13
Source File: Bukkit.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets the instance of the scoreboard manager.
 * <p>
 * This will only exist after the first world has loaded.
 *
 * @return the scoreboard manager or null if no worlds are loaded.
 */
public static ScoreboardManager getScoreboardManager() {
    return server.getScoreboardManager();
}