public class Scoreboard
extends java.lang.Object
Constructor and Description |
---|
Scoreboard() |
Modifier and Type | Method and Description |
---|---|
boolean |
addPlayerToTeam(java.lang.String player,
java.lang.String newTeam)
Adds a player to the given team
|
ScoreObjective |
addScoreObjective(java.lang.String name,
IScoreCriteria criteria)
Create and returns the score objective for the given name and ScoreCriteria
|
void |
broadcastScoreUpdate(java.lang.String scoreName) |
void |
broadcastScoreUpdate(java.lang.String scoreName,
ScoreObjective objective) |
void |
broadcastTeamCreated(ScorePlayerTeam playerTeam)
This packet will notify the players that this team is created, and that will register it on the client
|
void |
broadcastTeamInfoUpdate(ScorePlayerTeam playerTeam)
This packet will notify the players that this team is updated
|
void |
broadcastTeamRemove(ScorePlayerTeam playerTeam) |
ScorePlayerTeam |
createTeam(java.lang.String name) |
boolean |
entityHasObjective(java.lang.String name,
ScoreObjective objective)
Returns if the entity has the given ScoreObjective
|
static java.lang.String[] |
getDisplaySlotStrings() |
ScoreObjective |
getObjective(java.lang.String name)
Returns a ScoreObjective for the objective name
|
static java.lang.String |
getObjectiveDisplaySlot(int id)
Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null.
|
static int |
getObjectiveDisplaySlotNumber(java.lang.String name)
Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2 for 'belowName', otherwise -1.
|
ScoreObjective |
getObjectiveInDisplaySlot(int slotIn)
0 is tab menu, 1 is sidebar, 2 is below name
|
java.util.Collection<java.lang.String> |
getObjectiveNames() |
java.util.Map<ScoreObjective,Score> |
getObjectivesForEntity(java.lang.String name)
Returns all the objectives for the given entity
|
java.util.Collection<ScoreObjective> |
getObjectivesFromCriteria(IScoreCriteria criteria)
Returns all the objectives for the given criteria
|
Score |
getOrCreateScore(java.lang.String username,
ScoreObjective objective)
Get a player's score or create it if it does not exist
|
ScorePlayerTeam |
getPlayersTeam(java.lang.String username)
Gets the ScorePlayerTeam object for the given username.
|
java.util.Collection<ScoreObjective> |
getScoreObjectives() |
java.util.Collection<Score> |
getScores() |
java.util.Collection<Score> |
getSortedScores(ScoreObjective objective)
Returns an array of Score objects, sorting by Score.getScorePoints()
|
ScorePlayerTeam |
getTeam(java.lang.String teamName)
Retrieve the ScorePlayerTeam instance identified by the passed team name
|
java.util.Collection<java.lang.String> |
getTeamNames()
Retrieve all registered ScorePlayerTeam names
|
java.util.Collection<ScorePlayerTeam> |
getTeams()
Retrieve all registered ScorePlayerTeam instances
|
void |
onObjectiveDisplayNameChanged(ScoreObjective objective) |
void |
onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn)
Called when a score objective is added
|
void |
onScoreObjectiveRemoved(ScoreObjective objective) |
void |
onScoreUpdated(Score scoreIn) |
void |
removeEntity(Entity entityIn) |
void |
removeObjective(ScoreObjective objective) |
void |
removeObjectiveFromEntity(java.lang.String name,
ScoreObjective objective)
Remove the given ScoreObjective for the given Entity name.
|
void |
removePlayerFromTeam(java.lang.String username,
ScorePlayerTeam playerTeam)
Removes the given username from the given ScorePlayerTeam.
|
boolean |
removePlayerFromTeams(java.lang.String playerName) |
void |
removeTeam(ScorePlayerTeam playerTeam)
Removes the team from the scoreboard, updates all player memberships and broadcasts the deletion to all players
|
void |
setObjectiveInDisplaySlot(int objectiveSlot,
ScoreObjective objective)
0 is tab menu, 1 is sidebar, 2 is below name
|
public ScoreObjective getObjective(java.lang.String name)
public ScoreObjective addScoreObjective(java.lang.String name, IScoreCriteria criteria)
public java.util.Collection<ScoreObjective> getObjectivesFromCriteria(IScoreCriteria criteria)
public boolean entityHasObjective(java.lang.String name, ScoreObjective objective)
public Score getOrCreateScore(java.lang.String username, ScoreObjective objective)
public java.util.Collection<Score> getSortedScores(ScoreObjective objective)
public java.util.Collection<ScoreObjective> getScoreObjectives()
public java.util.Collection<java.lang.String> getObjectiveNames()
public void removeObjectiveFromEntity(java.lang.String name, ScoreObjective objective)
public java.util.Collection<Score> getScores()
public java.util.Map<ScoreObjective,Score> getObjectivesForEntity(java.lang.String name)
public void removeObjective(ScoreObjective objective)
public void setObjectiveInDisplaySlot(int objectiveSlot, ScoreObjective objective)
public ScoreObjective getObjectiveInDisplaySlot(int slotIn)
public ScorePlayerTeam getTeam(java.lang.String teamName)
public ScorePlayerTeam createTeam(java.lang.String name)
public void removeTeam(ScorePlayerTeam playerTeam)
public boolean addPlayerToTeam(java.lang.String player, java.lang.String newTeam)
public boolean removePlayerFromTeams(java.lang.String playerName)
public void removePlayerFromTeam(java.lang.String username, ScorePlayerTeam playerTeam)
public java.util.Collection<java.lang.String> getTeamNames()
public java.util.Collection<ScorePlayerTeam> getTeams()
public ScorePlayerTeam getPlayersTeam(java.lang.String username)
public void onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn)
public void onObjectiveDisplayNameChanged(ScoreObjective objective)
public void onScoreObjectiveRemoved(ScoreObjective objective)
public void onScoreUpdated(Score scoreIn)
public void broadcastScoreUpdate(java.lang.String scoreName)
public void broadcastScoreUpdate(java.lang.String scoreName, ScoreObjective objective)
public void broadcastTeamCreated(ScorePlayerTeam playerTeam)
public void broadcastTeamInfoUpdate(ScorePlayerTeam playerTeam)
public void broadcastTeamRemove(ScorePlayerTeam playerTeam)
public static java.lang.String getObjectiveDisplaySlot(int id)
public static int getObjectiveDisplaySlotNumber(java.lang.String name)
public static java.lang.String[] getDisplaySlotStrings()
public void removeEntity(Entity entityIn)