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

项目:Mythical-Gods-Mod    文件:CapeHelper.java   
public static void init() {
    // Clear all lists
    listDevs.clear();
    listTesters.clear();
    // Retrieve all players in the lists
    try {
        retrievePlayerData();
    } catch (IOException e) {
        e.printStackTrace();
    }
    // Obtain texture files
    Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_DEV, new ImageBufferDownload());
    Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_TESTER, new ImageBufferDownload());
    // Register tickhandler to set the capes
    TickRegistry.registerTickHandler(new CapeTickHandler(), Side.CLIENT);
}
项目: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());
}
项目: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;
}
项目:Resilience-Client-Source    文件:AbstractClientPlayer.java   
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
项目:RoboticMinions    文件:SkinHelper.java   
private static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) {
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), STEVE, new ImageBufferDownload());
}
项目: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 static ThreadDownloadImageData func_110304_a(ResourceLocation p_110304_0_, String p_110304_1_) {
   return func_110301_a(p_110304_0_, func_110300_d(p_110304_1_), field_110314_b, new ImageBufferDownload());
}
项目:RuneCraftery    文件:AbstractClientPlayer.java   
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
项目:BetterNutritionMod    文件:AbstractClientPlayer.java   
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
{
    return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), locationStevePng, new ImageBufferDownload());
}
项目:secri    文件:HDSkinHandler.java   
public static void updateSkins(World world){
    List<EntityPlayer> players = world.playerEntities;
    for(EntityPlayer p : players){


    if(p.skinUrl!="http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png"){

        try{    


        SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

        URL url = new URL(SkinURL);

        HttpURLConnection con = ((HttpURLConnection) url.openConnection());
        con.setConnectTimeout(1000);
        con.setRequestMethod("HEAD");
        try{
        int responseCode = con.getResponseCode();
            if  (responseCode ==200){

                    p.skinUrl = SkinURL;


                    p.worldObj.obtainEntitySkin(p);






            }else{
                SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.obtainEntitySkin(p);


            }
        }catch (SocketTimeoutException ste){
            SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.obtainEntitySkin(p);


        }
        }catch (IOException e){
            SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.obtainEntitySkin(p);


        }



        p.cloakUrl = "http://home.maemesoft.wo.tc:25564/MinecraftCloaks/" + p.username + ".png";
        p.cloakUrl = p.cloakUrl;

        mc1 = ModLoader.getMinecraftInstance();;

        mc1.renderEngine.obtainImageData(p.cloakUrl, new ImageBufferDownload());


        }
    }
}
项目:secri    文件:HDSkinHandler.java   
public static void forceUpdateSkins(World world){
    List<EntityPlayer> players = world.playerEntities;
    for(EntityPlayer p : players){



    if(p.skinUrl!="http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png"){

        try{    


        SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

        URL url = new URL(SkinURL);

        HttpURLConnection con = ((HttpURLConnection) url.openConnection());
        con.setConnectTimeout(1000);
        con.setRequestMethod("HEAD");
        try{
        int responseCode = con.getResponseCode();
            if  (responseCode ==200){


                    p.skinUrl = SkinURL;

                    p.worldObj.releaseEntitySkin(p);
                    p.worldObj.obtainEntitySkin(p);






            }else{
                SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.releaseEntitySkin(p);
                    p.worldObj.obtainEntitySkin(p);



            }
        }catch (SocketTimeoutException ste){
            SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.releaseEntitySkin(p);
                    p.worldObj.obtainEntitySkin(p);


        }
        }catch (IOException e){
            SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

                    p.skinUrl = SkinURL;

                    p.worldObj.releaseEntitySkin(p);
                    p.worldObj.obtainEntitySkin(p);


        }



        p.cloakUrl = "http://home.maemesoft.wo.tc:25564/MinecraftCloaks/" + p.username + ".png";
        p.cloakUrl = p.cloakUrl;

        mc1 = ModLoader.getMinecraftInstance();;

        mc1.renderEngine.obtainImageData(p.cloakUrl, new ImageBufferDownload());


        }else{
            p.worldObj.releaseEntitySkin(p);
            p.worldObj.obtainEntitySkin(p);
        }
    }
}