Add Scoreboard API and Command. Adds BUKKIT-3776, BUKKIT-3834

The implementation is designed around having both a main scoreboard and
numberous plugin managed scoreboards that can be displayed to specific
players.

Plugin managed scoreboards are active so long as a reference is kept by a
plugin, or it has been registered as a player's active scoreboard. Objects
specific to a scoreboard remain active until unregistered (which remove a
reference to the owning scoreboard), but quickly fail if accessed
post-unregistration.

By: mbax <github@phozop.net>
This commit is contained in:
Bukkit/Spigot
2013-03-20 14:14:42 -04:00
parent 33ebd8ebe7
commit 0a419b9e4d
13 changed files with 1171 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.conversations.Conversable;
import org.bukkit.map.MapView;
import org.bukkit.plugin.messaging.PluginMessageRecipient;
import org.bukkit.scoreboard.Scoreboard;
/**
* Represents a player, connected or not
@@ -626,4 +627,19 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @throws IllegalArgumentException Thrown if the URL is too long.
*/
public void setTexturePack(String url);
/**
* Gets the Scoreboard displayed to this player
*
* @return The current scoreboard seen by this player
*/
public Scoreboard getScoreboard();
/**
* Sets the player's visible Scoreboard
* Scoreboard must be currently registered or an IllegalArgumentException is thrown
*
* @param scoreboard New Scoreboard for the player
*/
public void setScoreboard(Scoreboard scoreboard);
}