Prevent duplicate profiles from being created

This commit is contained in:
nossr50 2012-04-04 07:46:57 -07:00
parent 80526c0e06
commit 06c3a588bf

View File

@ -105,7 +105,7 @@ public class Users {
* @return the player's profile * @return the player's profile
*/ */
public static PlayerProfile getProfileByName(String playerName) { public static PlayerProfile getProfileByName(String playerName) {
if (Bukkit.getServer().getOfflinePlayer(playerName).isOnline()) { if (Bukkit.getServer().getOfflinePlayer(playerName).isOnline() || players.containsKey(playerName.toLowerCase())) {
if (players.get(playerName.toLowerCase()) != null) { if (players.get(playerName.toLowerCase()) != null) {
return players.get(playerName.toLowerCase()); return players.get(playerName.toLowerCase());
} }