Java源码示例:org.bukkit.scoreboard.ScoreboardManager
示例1
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.");
}
}
}
示例2
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);
}
示例3
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);
}
示例4
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);
}
示例5
/**
* 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);
}
}
示例6
@Inject ScoreboardMatchModule(ScoreboardManager scoreboardManager, SettingCallbackManager settingCallbackManager) {
this.hiddenScoreboard = scoreboardManager.getNewScoreboard();
this.settingCallbackManager = settingCallbackManager;
}
示例7
@Override
public ScoreboardManager getScoreboardManager() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例8
@Override
public ScoreboardManager getScoreboardManager() {
return null;
}
示例9
public ScoreboardManager getScoreboardManager() {
return this.scoreboardManager;
}
示例10
public TeamManager() {
ScoreboardManager manager = Bukkit.getScoreboardManager();
teamBoard = manager.getNewScoreboard();
}
示例11
/**
*
*/
private Scoreboards() {
ScoreboardManager manager = Bukkit.getScoreboardManager();
board = manager.getNewScoreboard();
}
示例12
/**
* 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();
示例13
/**
* 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();
}