FriendEntry.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:RewiMod 作者:
public FriendEntry(String username, String status, String rank) {
    this.username = username;
    this.status = status;
    this.rank = rank;
    this.headLocation = new ResourceLocation("rewimod/" + username + "/head");

    try {
        URL obj = new URL("https://minotar.net/helm/" + username + "/32.png");
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();

        // optional default is GET
        con.setRequestMethod("GET");

        //add request header
        con.setRequestProperty("User-Agent", "Minecraft");

        InputStream stream = con.getInputStream();
        this.headImage = TextureUtil.readBufferedImage(stream);
    } catch (Exception ex) {
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号