ItemUtils_V1_10_R1.java 文件源码

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

项目:GameBoxx 作者:
@Override
public SkullMeta setSkullTexture(SkullMeta meta, String skinUrl) {
    if (meta == null) {
        return meta;
    }

    GameProfile profile = new GameProfile(UUID.randomUUID(), null);
    profile.getProperties().put("textures", new Property("textures", new String(Utils.getSkullTexture(skinUrl))));

    try {
        Field profileField = meta.getClass().getDeclaredField("profile");
        profileField.setAccessible(true);
        profileField.set(meta, profile);

    } catch (NoSuchFieldException | IllegalAccessException e) {
        e.printStackTrace();
    }
    return meta;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号