From 00eba538b0a8f1ee2d775216ddeb5ba2ececadd7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 17 Jan 2015 19:59:16 +1100 Subject: [PATCH] Fix mismatch between teams and player teams. --- .../org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java | 5 +++-- 1 file 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 8d0e9503f4..bb804101ff 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); }