Initialize FTeamWrapper if it doesn't exist. Fixes #179

This commit is contained in:
eueln 2014-12-14 16:15:25 -06:00
parent 10fd3f082a
commit 6d2ca16002

View File

@ -8,7 +8,6 @@ import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.Team;
import java.util.*; import java.util.*;
import java.util.logging.Level;
public class FTeamWrapper { public class FTeamWrapper {
private static final Map<Faction, FTeamWrapper> wrappers = new HashMap<Faction, FTeamWrapper>(); private static final Map<Faction, FTeamWrapper> wrappers = new HashMap<Faction, FTeamWrapper>();
@ -94,11 +93,12 @@ public class FTeamWrapper {
if (!FScoreboard.isSupportedByServer()) { if (!FScoreboard.isSupportedByServer()) {
return; return;
} }
if (!wrappers.containsKey(faction)) { if (!wrappers.containsKey(faction)) {
P.p.log(Level.WARNING, "Something went wrong when updating the prefix for %s", faction.getTag()); applyUpdates(faction);
return; } else {
wrappers.get(faction).updatePrefixes();
} }
wrappers.get(faction).updatePrefixes();
} }
protected static void track(FScoreboard fboard) { protected static void track(FScoreboard fboard) {