Implement Scoreboard API. Adds BUKKIT-3776

This implementation facilitates the correspondence of the Bukkit Scoreboard
API to the internal minecraft implementation.

When the first scoreboard is loaded, the scoreboard manager will be created.
It uses the newly added WeakCollection for handling plugin scoreboard
references to update the respective objectives. When a scoreboard contains no
more active references, it should be garbage collected.

An active reference can be held by a still registered objective, team, and
transitively a score for a still registered objective. An internal reference
will also be kept if a player's specific scoreboard has been set, and will
remain persistent until that player logs out.

A player's specific scoreboard becomes the scoreboard used when determining
team structure for the player's attacking damage and the player's vision.
This commit is contained in:
mbax
2013-03-22 17:21:33 -04:00
committed by Wesley Wolfe
parent 5634d9f701
commit d95a4705cb
15 changed files with 756 additions and 32 deletions

View File

@@ -225,6 +225,8 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
world.getWorld().getPopulators().addAll(gen.getDefaultPopulators(world.getWorld()));
}
this.server.scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(this, world.getScoreboard());
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld()));
world.addIWorldAccess(new WorldManager(this, world));