CapeUtils.java 文件源码

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

项目:BaseClient 作者:
public static void downloadCape(final AbstractClientPlayer p_downloadCape_0_)
{
    String s = p_downloadCape_0_.getNameClear();

    if (s != null && !s.isEmpty())
    {
        String s1 = "http://s.optifine.net/capes/" + s + ".png";
        String s2 = FilenameUtils.getBaseName(s1);
        final ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s2);
        TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
        ITextureObject itextureobject = texturemanager.getTexture(resourcelocation);

        if (itextureobject != null && itextureobject instanceof ThreadDownloadImageData)
        {
            ThreadDownloadImageData threaddownloadimagedata = (ThreadDownloadImageData)itextureobject;

            if (threaddownloadimagedata.imageFound != null)
            {
                if (threaddownloadimagedata.imageFound.booleanValue())
                {
                    p_downloadCape_0_.setLocationOfCape(resourcelocation);
                }

                return;
            }
        }

        IImageBuffer iimagebuffer = new IImageBuffer()
        {
            ImageBufferDownload ibd = new ImageBufferDownload();
            public BufferedImage parseUserSkin(BufferedImage image)
            {
                return CapeUtils.parseCape(image);
            }
            public void skinAvailable()
            {
                p_downloadCape_0_.setLocationOfCape(resourcelocation);
            }
        };
        ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s1, (ResourceLocation)null, iimagebuffer);
        threaddownloadimagedata1.pipeline = true;
        texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号