summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-01-17 19:59:16 +1100
committermd_5 <git@md-5.net>2015-01-17 19:59:16 +1100
commit00eba538b0a8f1ee2d775216ddeb5ba2ececadd7 (patch)
tree0022067bd119c8d632aa9dd7cda7ba5c6eda7397
parent42ebec1f71bebdd8768e6024828a964e48154588 (diff)
downloadcraftbukkit-00eba538b0a8f1ee2d775216ddeb5ba2ececadd7.tar
craftbukkit-00eba538b0a8f1ee2d775216ddeb5ba2ececadd7.tar.gz
craftbukkit-00eba538b0a8f1ee2d775216ddeb5ba2ececadd7.tar.lz
craftbukkit-00eba538b0a8f1ee2d775216ddeb5ba2ececadd7.tar.xz
craftbukkit-00eba538b0a8f1ee2d775216ddeb5ba2ececadd7.zip
Fix mismatch between teams and player teams.
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index 8d0e9503..bb804101 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -105,13 +105,14 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
public Team getPlayerTeam(OfflinePlayer player) throws IllegalArgumentException {
Validate.notNull(player, "OfflinePlayer cannot be null");
- return getTeam(player.getName());
+ ScoreboardTeam team = board.getPlayerTeam(player.getName());
+ return team == null ? null : new CraftTeam(this, team);
}
public Team getTeam(String teamName) throws IllegalArgumentException {
Validate.notNull(teamName, "Team name cannot be null");
- ScoreboardTeam team = board.getPlayerTeam(teamName);
+ ScoreboardTeam team = board.getTeam(teamName);
return team == null ? null : new CraftTeam(this, team);
}