java类net.minecraft.client.renderer.ThreadDownloadImageData的实例源码

AbstractClientPlayer.java 文件源码 项目:Resilience-Client-Source 阅读 19 收藏 0 点赞 0 评论 0
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
AbstractClientPlayer.java 文件源码 项目:Resilience-Client-Source 阅读 28 收藏 0 点赞 0 评论 0
public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null);
}
ThreadDownloadImage.java 文件源码 项目:Resilience-Client-Source 阅读 14 收藏 0 点赞 0 评论 0
public ThreadDownloadImage(ThreadDownloadImageData parent, String urlStr, IImageBuffer imageBuffer)
{
    this.parent = parent;
    this.urlStr = urlStr;
    this.imageBuffer = imageBuffer;
}
SkinHelper.java 文件源码 项目:RoboticMinions 阅读 32 收藏 0 点赞 0 评论 0
private static ThreadDownloadImageData getTextureSkin(String player) {
    return downloadThreads.get(player);
}
SkinHelper.java 文件源码 项目:RoboticMinions 阅读 27 收藏 0 点赞 0 评论 0
private static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) {
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), STEVE, new ImageBufferDownload());
}
IvTextureCreatorMC.java 文件源码 项目:IvToolkit 阅读 56 收藏 0 点赞 0 评论 0
public static BufferedImage getImage(IResourceManager resourceManager, ResourceLocation location, Logger logger) throws IOException
{
    ITextureObject textureObject = Minecraft.getMinecraft().getTextureManager().getTexture(location);

    if (textureObject instanceof ThreadDownloadImageData)
    {
        return ReflectionHelper.getPrivateValue(ThreadDownloadImageData.class, (ThreadDownloadImageData) textureObject, "bufferedImage", "field_110560_d");
    }
    else if (textureObject instanceof LayeredTexture)
    {
        BufferedImage bufferedimage = null;

        for (Object layeredTextureNameObj : ((LayeredTexture) textureObject).layeredTextureNames)
        {
            String layeredTextureName = (String) layeredTextureNameObj;

            if (layeredTextureName != null)
            {
                try (InputStream inputstream = resourceManager.getResource(new ResourceLocation(layeredTextureName)).getInputStream())
                {
                    BufferedImage bufferImageLayer = ImageIO.read(inputstream);

                    if (bufferedimage == null)
                    {
                        bufferedimage = new BufferedImage(bufferImageLayer.getWidth(), bufferImageLayer.getHeight(), 2);
                    }

                    bufferedimage.getGraphics().drawImage(bufferImageLayer, 0, 0, null);
                }
            }
        }

        return bufferedimage;
    }
    else if (textureObject instanceof PreBufferedTexture)
    {
        return ((PreBufferedTexture) textureObject).getBufferedImage();
    }
    else
    {
        IResource iresource = resourceManager.getResource(location);

        try (InputStream inputstream = iresource.getInputStream())
        {
            return ImageIO.read(inputstream);
        }
    }
}
SkinManager.java 文件源码 项目:ExpandedRailsMod 阅读 19 收藏 0 点赞 0 评论 0
/**
 * May download the skin if its not in the cache, can be passed a SkinManager#SkinAvailableCallback for handling
 */
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, @Nullable final SkinManager.SkinAvailableCallback skinAvailableCallback)
{
    final ResourceLocation resourcelocation = new ResourceLocation("skins/" + profileTexture.getHash());
    ITextureObject itextureobject = this.textureManager.getTexture(resourcelocation);

    if (itextureobject != null)
    {
        if (skinAvailableCallback != null)
        {
            skinAvailableCallback.skinAvailable(textureType, resourcelocation, profileTexture);
        }
    }
    else
    {
        File file1 = new File(this.skinCacheDir, profileTexture.getHash().length() > 2 ? profileTexture.getHash().substring(0, 2) : "xx");
        File file2 = new File(file1, profileTexture.getHash());
        final IImageBuffer iimagebuffer = textureType == Type.SKIN ? new ImageBufferDownload() : null;
        ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, profileTexture.getUrl(), DefaultPlayerSkin.getDefaultSkinLegacy(), new IImageBuffer()
        {
            public BufferedImage parseUserSkin(BufferedImage image)
            {
                if (iimagebuffer != null)
                {
                    image = iimagebuffer.parseUserSkin(image);
                }

                return image;
            }
            public void skinAvailable()
            {
                if (iimagebuffer != null)
                {
                    iimagebuffer.skinAvailable();
                }

                if (skinAvailableCallback != null)
                {
                    skinAvailableCallback.skinAvailable(textureType, resourcelocation, profileTexture);
                }
            }
        });
        this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
SkinManager.java 文件源码 项目:Cauldron 阅读 17 收藏 0 点赞 0 评论 0
public ResourceLocation func_152789_a(MinecraftProfileTexture p_152789_1_, final Type p_152789_2_, final SkinManager.SkinAvailableCallback p_152789_3_)
{
    final ResourceLocation resourcelocation = new ResourceLocation("skins/" + p_152789_1_.getHash());
    ITextureObject itextureobject = this.field_152795_c.getTexture(resourcelocation);

    if (itextureobject != null)
    {
        if (p_152789_3_ != null)
        {
            p_152789_3_.func_152121_a(p_152789_2_, resourcelocation);
        }
    }
    else
    {
        File file1 = new File(this.field_152796_d, p_152789_1_.getHash().substring(0, 2));
        File file2 = new File(file1, p_152789_1_.getHash());
        final ImageBufferDownload imagebufferdownload = p_152789_2_ == Type.SKIN ? new ImageBufferDownload() : null;
        ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, p_152789_1_.getUrl(), field_152793_a, new IImageBuffer()
        {
            private static final String __OBFID = "CL_00001828";
            public BufferedImage parseUserSkin(BufferedImage p_78432_1_)
            {
                if (imagebufferdownload != null)
                {
                    p_78432_1_ = imagebufferdownload.parseUserSkin(p_78432_1_);
                }

                return p_78432_1_;
            }
            public void func_152634_a()
            {
                if (imagebufferdownload != null)
                {
                    imagebufferdownload.func_152634_a();
                }

                if (p_152789_3_ != null)
                {
                    p_152789_3_.func_152121_a(p_152789_2_, resourcelocation);
                }
            }
        });
        this.field_152795_c.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
SkinManager.java 文件源码 项目:Cauldron 阅读 19 收藏 0 点赞 0 评论 0
public ResourceLocation func_152789_a(MinecraftProfileTexture p_152789_1_, final Type p_152789_2_, final SkinManager.SkinAvailableCallback p_152789_3_)
{
    final ResourceLocation resourcelocation = new ResourceLocation("skins/" + p_152789_1_.getHash());
    ITextureObject itextureobject = this.field_152795_c.getTexture(resourcelocation);

    if (itextureobject != null)
    {
        if (p_152789_3_ != null)
        {
            p_152789_3_.func_152121_a(p_152789_2_, resourcelocation);
        }
    }
    else
    {
        File file1 = new File(this.field_152796_d, p_152789_1_.getHash().substring(0, 2));
        File file2 = new File(file1, p_152789_1_.getHash());
        final ImageBufferDownload imagebufferdownload = p_152789_2_ == Type.SKIN ? new ImageBufferDownload() : null;
        ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, p_152789_1_.getUrl(), field_152793_a, new IImageBuffer()
        {
            private static final String __OBFID = "CL_00001828";
            public BufferedImage parseUserSkin(BufferedImage p_78432_1_)
            {
                if (imagebufferdownload != null)
                {
                    p_78432_1_ = imagebufferdownload.parseUserSkin(p_78432_1_);
                }

                return p_78432_1_;
            }
            public void func_152634_a()
            {
                if (imagebufferdownload != null)
                {
                    imagebufferdownload.func_152634_a();
                }

                if (p_152789_3_ != null)
                {
                    p_152789_3_.func_152121_a(p_152789_2_, resourcelocation);
                }
            }
        });
        this.field_152795_c.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
AbstractClientPlayer.java 文件源码 项目:RuneCraftery 阅读 20 收藏 0 点赞 0 评论 0
public ThreadDownloadImageData func_110309_l() {
   return this.field_110316_a;
}


问题


面经


文章

微信
公众号

扫码关注公众号