Java 类net.minecraft.client.renderer.ThreadDownloadImageData 实例源码

项目:vsminecraft    文件:CapeBufferDownload.java   
public ThreadDownloadImageData downloadCape() 
{
    try {
        File capeFile = new File(resourceLocation.getResourcePath() + ".png");

        if(capeFile.exists())
        {
            capeFile.delete();
        }

        TextureManager manager = Minecraft.getMinecraft().getTextureManager();
        ThreadDownloadImageData data = new ThreadDownloadImageData(capeFile, staticCapeUrl, null, null);

        manager.loadTexture(resourceLocation, data);

        return data;
    } catch(Exception e) {
        e.printStackTrace();
    }

    return null;
}
项目:CapesAPI-ClientImplementation    文件:CapesAPI.java   
/**
 * Fetches a cape for the given player and stores it's ResourceLocation in
 * the capes map
 *
 * @param uuid UUID of the player to load the cape for
 */
public static void loadCape(final UUID uuid) {
  if (CapesAPI.hasPendingRequests(uuid)) {
    return;
  }

  CapesAPI.setCape(uuid, null);
  String url = String.format(CapesAPI.BASE_URL, uuid);
  ResourceLocation resourceLocation = new ResourceLocation(
          String.format("capesapi/capes/%s.png", new Date().getTime())
  );
  TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
  ThreadDownloadImageData threadDownloadImageData = new ThreadDownloadImageData(null, url, null, new IImageBuffer() {
    @Override
    public BufferedImage parseUserSkin(BufferedImage image) {
      return image;
    }

    @Override
    public void skinAvailable() {
      CapesAPI.setCape(uuid, resourceLocation);

      // useless reloading Image whenever a Player dies, joins, leaves and re-enters Render range 
      // CapesAPI.pendingRequests.remove(uuid);
    }
  });
  textureManager.loadTexture(resourceLocation, threadDownloadImageData);
  CapesAPI.pendingRequests.add(uuid);
}
项目:MineLittlePony    文件:Pony.java   
@Nullable
private BufferedImage getBufferedImage(@Nonnull ResourceLocation textureResourceLocation) {
    BufferedImage skinImage = null;
    try {
        IResource skin = Minecraft.getMinecraft().getResourceManager().getResource(textureResourceLocation);
        skinImage = TextureUtil.readBufferedImage(skin.getInputStream());
        MineLittlePony.logger.debug("Obtained skin from resource location {}", textureResourceLocation);
        // this.checkSkin(skinImage);
    } catch (IOException e) {

        try {
            ITextureObject e2 = Minecraft.getMinecraft().getTextureManager().getTexture(textureResourceLocation);
            if (e2 instanceof ThreadDownloadImageData) {

                skinImage = PonyFields.downloadedImage.get((ThreadDownloadImageData) e2);
                if (skinImage != null) {
                    MineLittlePony.logger.debug("Successfully reflected downloadedImage from texture object", e);
                    // this.checkSkin(skinImage);
                }
            } else if (e2 instanceof ThreadDownloadImageETag) {
                skinImage = ((ThreadDownloadImageETag) e2).getBufferedImage();
            } else if (e2 instanceof DynamicTextureImage) {
                skinImage = ((DynamicTextureImage) e2).getImage();
            }
        } catch (Exception ignored) {

        }
    }

    return skinImage;
}
项目:Kingdom-Keys-Re-Coded    文件:StaticCape.java   
public void setURL (URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:Mocap    文件:RenderEntityMocap.java   
public static ThreadDownloadImageData getDownloadImageSkin(
        ResourceLocation par0ResourceLocation, String par1Str) {
    String theUrl = "";

    if (par1Str.matches("\\d{10,}")) {
        theUrl = getSkindexUrl(par1Str);
    } else {
        theUrl = getSkinUrl(par1Str);
    }

    return getDownloadImage(par0ResourceLocation, theUrl, locationStevePng,
            new ImageBufferDownload());
}
项目:Nuclear-Control    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:SolderCraft    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:mcpvp-mod    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:CORE-API    文件:ClientProxy.java   
/**
 * Adds capes to our team Player Entities. May become invalid as soon as the
 * UUID system is fully implemented by Mojang.
 */
@Override
public void registerTeamCapes()
{
    final String capeURL = "http://www.mccapes.com/GalleryImages6x/0c1865261d2d0247fb6b776bdc5d6730.png"; // Temporary.
                                                                                                          // Can
                                                                                                          // someone
                                                                                                          // make
                                                                                                          // us
                                                                                                          // a
                                                                                                          // proper
                                                                                                          // cape?
                                                                                                          // We
                                                                                                          // should
                                                                                                          // be
                                                                                                          // able
                                                                                                          // to
                                                                                                          // have
                                                                                                          // a
                                                                                                          // HD
                                                                                                          // one
                                                                                                          // I
                                                                                                          // think!

    String[] teamMembers =
        { "nxsupert, ProfessorVennie", "roborave", "InternetAthiest",
                "MushroomLT" }; // Please add your minecraft user names
                                // here. You will get a cape if you do so!

    ThreadDownloadImageData capeImage = new ThreadDownloadImageData(
            capeURL, null, null);
    Minecraft mcInstance = Minecraft.getMinecraft();

    for (String username : teamMembers)
    {
        mcInstance.renderEngine.loadTexture(new ResourceLocation("cloaks/"
                + username), capeImage);
    }
}
项目:RuneCraftery    文件:ThreadDownloadImageDataINNER1.java   
public void run() {
   HttpURLConnection var1 = null;

   try {
      var1 = (HttpURLConnection)(new URL(ThreadDownloadImageData.func_110554_a(this.field_110932_a))).openConnection(Minecraft.func_71410_x().func_110437_J());
      var1.setDoInput(true);
      var1.setDoOutput(false);
      var1.connect();
      if(var1.getResponseCode() / 100 != 2) {
         return;
      }

      BufferedImage var2 = ImageIO.read(var1.getInputStream());
      if(ThreadDownloadImageData.func_110555_b(this.field_110932_a) != null) {
         var2 = ThreadDownloadImageData.func_110555_b(this.field_110932_a).func_78432_a(var2);
      }

      this.field_110932_a.func_110556_a(var2);
   } catch (Exception var6) {
      var6.printStackTrace();
   } finally {
      if(var1 != null) {
         var1.disconnect();
      }

   }

}
项目:Realms-of-Chaos    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:CodeLyokoMod    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:DeveloperCapes    文件:StaticCape.java   
public void setURL(URL url) {
    if (url == null) {
        this.texture = null;
        return;
    }
    this.texture = new ThreadDownloadImageData(null, url.toString(), null, new HDImageBuffer());
}
项目:RankCapes    文件:StaticCape.java   
@Override
public void loadTexture(AbstractClientPlayer player)
{
    if (this.texture == null)
    {
        this.texture = readImageData(capeImage);
    }

    ThreadDownloadImageData data = player.getTextureCape();
    data.setBufferedImage(this.capeImage);
    TextureUtil.uploadTexture(data.getGlTextureId(), this.texture, capeImage.getWidth(), capeImage.getHeight());
}
项目:Nucleum-Omnium    文件:DevCapes.java   
/**
 * Object constructor.
 */
private DevCapes()
{
    users = new HashMap<String, String>();
    capeResources = new HashMap<String, ResourceLocation>();
    downloadThreads = new HashMap<String, ThreadDownloadImageData>();
}
项目:Nucleum-Omnium    文件:DevCapes.java   
/**
 * Adds an ThreadDownloadImageData. Needed to change cape.
 *
 * @param parGroup
 * @param parResource
 */
void addDownloadThread(String parGroup, ThreadDownloadImageData parResource)
{
    if (getDownloadThread(parGroup) == null)
    {
        downloadThreads.put(parGroup, parResource);
    }
}
项目:Nucleum-Omnium    文件:DevCapes.java   
/**
 * Used to download images. Copied from AbstractClientPlayer to remove
 * a conditional.
 *
 * @param par0ResourceLocation
 * @param par1Str
 * @param par2ResourceLocation
 * @param par3IImageBuffer
 * @return
 */
private static ThreadDownloadImageData makeDownloadThread(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer)
{
    TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();

    TextureObject object = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer);
    // Binds ResourceLocation to this.
    texturemanager.loadTexture(par0ResourceLocation, object);

    return (ThreadDownloadImageData) object;
}
项目:DecompiledMinecraft    文件:SkinManager.java   
/**
 * 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 p_152789_2_, 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(p_152789_2_, 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 = p_152789_2_ == 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(p_152789_2_, resourcelocation, profileTexture);
                }
            }
        });
        this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
项目:BaseClient    文件:CapeUtils.java   
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);
    }
}
项目:BaseClient    文件:SkinManager.java   
/**
 * 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 p_152789_2_, 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(p_152789_2_, 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 = p_152789_2_ == 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(p_152789_2_, resourcelocation, profileTexture);
                }
            }
        });
        this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
项目:BaseClient    文件:AbstractClientPlayer.java   
private void downloadCape(String p_downloadCape_1_)
{
    if (p_downloadCape_1_ != null && !p_downloadCape_1_.isEmpty())
    {
        p_downloadCape_1_ = StringUtils.stripControlCodes(p_downloadCape_1_);
        String s = "http://s.optifine.net/capes/" + p_downloadCape_1_ + ".png";
        String s1 = FilenameUtils.getBaseName(s);
        final ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s1);
        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())
                {
                    this.ofLocationCape = resourcelocation;
                }

                return;
            }
        }

        IImageBuffer iimagebuffer = new IImageBuffer()
        {
            ImageBufferDownload ibd = new ImageBufferDownload();
            public BufferedImage parseUserSkin(BufferedImage image)
            {
                return AbstractClientPlayer.this.parseCape(image);
            }
            public void skinAvailable()
            {
                AbstractClientPlayer.this.ofLocationCape = resourcelocation;
            }
        };
        ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s, (ResourceLocation)null, iimagebuffer);
        texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1);
    }
}
项目:BaseClient    文件:SkinManager.java   
/**
 * 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 p_152789_2_, 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(p_152789_2_, 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 = p_152789_2_ == 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(p_152789_2_, resourcelocation, profileTexture);
                }
            }
        });
        this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata);
    }

    return resourcelocation;
}
项目:Backmemed    文件:SkinManager.java   
/**
 * 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;
}
项目:Backmemed    文件:CapeUtils.java   
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);
    }
}
项目:CustomWorldGen    文件:SkinManager.java   
/**
 * 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;
}
项目:CrystalMod    文件:DownloadedTextures.java   
public static ThreadDownloadImageData getDownloadImageFace(ResourceLocation par0ResourceLocation, String par1Str, MCAPIType type, int size, boolean helmet)
  {
ResourceLocation defaultF = new ResourceLocation(String.format("crystalmod:textures/misc/steve_face_%s.png", type.ending));
      return getDownloadImage(par0ResourceLocation, getFaceUrl(par1Str, type, size, helmet), defaultF, new ImageBufferFaceLarge(size, size));
  }
项目:CrystalMod    文件:DownloadedTextures.java   
public static ThreadDownloadImageData getDownloadImagePlayer(ResourceLocation par0ResourceLocation, String par1Str, MCAPIType type, int size, boolean helmet)
  {
ResourceLocation defaultF = new ResourceLocation(String.format("crystalmod:textures/misc/steve_%s.png", type.ending));
      return getDownloadImage(par0ResourceLocation, getPlayerUrl(par1Str, type, size, helmet), defaultF, new ImageBufferFaceLarge(size, size*2));
  }
项目:vsminecraft    文件:CapeBufferDownload.java   
public ThreadDownloadImageData getImage()
{
    return capeImage;
}
项目:Resilience-Client-Source    文件:AbstractClientPlayer.java   
public ThreadDownloadImageData getTextureSkin()
{
    return this.downloadImageSkin;
}
项目:Resilience-Client-Source    文件:AbstractClientPlayer.java   
public ThreadDownloadImageData getTextureCape()
{
    return this.downloadImageCape;
}
项目:Resilience-Client-Source    文件:AbstractClientPlayer.java   
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
项目:Resilience-Client-Source    文件:AbstractClientPlayer.java   
public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null);
}
项目:Resilience-Client-Source    文件:ThreadDownloadImage.java   
public ThreadDownloadImage(ThreadDownloadImageData parent, String urlStr, IImageBuffer imageBuffer)
{
    this.parent = parent;
    this.urlStr = urlStr;
    this.imageBuffer = imageBuffer;
}
项目:RoboticMinions    文件:SkinHelper.java   
private static ThreadDownloadImageData getTextureSkin(String player) {
    return downloadThreads.get(player);
}
项目:RoboticMinions    文件:SkinHelper.java   
private static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) {
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), STEVE, new ImageBufferDownload());
}
项目:IvToolkit    文件:IvTextureCreatorMC.java   
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);
        }
    }
}
项目:ExpandedRailsMod    文件:SkinManager.java   
/**
 * 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;
}
项目:Cauldron    文件:SkinManager.java   
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;
}
项目:Cauldron    文件:SkinManager.java   
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;
}
项目:RuneCraftery    文件:AbstractClientPlayer.java   
public ThreadDownloadImageData func_110309_l() {
   return this.field_110316_a;
}