public static PlayerData getPlayerData(Player player)
    {
        PlayerData playerdata = PlayerData.userinfo.get(player);

        if (playerdata == null)
        {
            Iterator<Entry<Player, PlayerData>> it = userinfo.entrySet().iterator();
            while (it.hasNext())
            {
                Entry<Player, PlayerData> pair = it.next();
                PlayerData playerdata_test = pair.getValue();

                if (playerdata_test.player_name.equalsIgnoreCase(player.getName()))
                {
                    if (Bukkit.getOnlineMode())
                    {
                        playerdata = playerdata_test;
                        break;
                    }
                    else
                    {
                        if (playerdata_test.ip_address.equalsIgnoreCase(player.getAddress().getAddress().getHostAddress()))
                        {
                            playerdata = playerdata_test;
                            break;
                        }
                    }
                }
            }
        }
        
        if (playerdata == null)
        {
            playerdata = new PlayerData(player);
            PlayerData.userinfo.put(player, playerdata);
        }

        return playerdata;
    }