Possibly solved the faction creation issue. Changed the best id match to something more reasonable

This commit is contained in:
Olof Larsson
2011-10-23 12:07:20 +02:00
parent 32624e0339
commit 4f7fd6dd96
4 changed files with 43 additions and 26 deletions

View File

@@ -146,7 +146,7 @@ public class Factions extends EntityCollection<Faction>
return null;
}
public Faction getBestTagMatch(String pattern)
public Faction getBestTagMatch(String searchFor)
{
Map<String, Faction> tag2faction = new HashMap<String, Faction>();
@@ -156,7 +156,7 @@ public class Factions extends EntityCollection<Faction>
tag2faction.put(ChatColor.stripColor(faction.getTag()), faction);
}
String tag = TextUtil.getWhereLongestCommonStartCI(tag2faction.keySet(), pattern);
String tag = TextUtil.getBestStartWithCI(tag2faction.keySet(), searchFor);
if (tag == null) return null;
return tag2faction.get(tag);
}