Jump to content

Recommended Posts

Posted

Hi! Hwo to change player skin in modification? I tried to change RenderPlayer using RenderRegistry, but i recevie this error:

Failed to load texture java.io.FileNotFoundException

I know i have to download this skin to mine disc but it doesn't work:

    public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str)
    {
        return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str), texture, new ImageBufferDownload());
    }

    /*public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str)
    {
        return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str), (ResourceLocation)null, (IImageBuffer)null);
    }*/

    private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer)
    {
        TextureManager var4 = Minecraft.getMinecraft().getTextureManager();
        Object var5 = var4.getTexture(par0ResourceLocation);

        if (var5 == null)
        {
            var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer);
            var4.loadTexture(par0ResourceLocation, (ITextureObject)var5);
        }

        return (ThreadDownloadImageData)var5;
    }

Thanks for help:)

Posted

Skins are being held in AbstractClientPlayer.class

 

They are private so you have to use reflection to access them and override with your own.

1.7.10 is no longer supported by forge, you are on your own.

Posted

IS this code good?:

	@Override
protected ResourceLocation getEntityTexture(AbstractClientPlayer par1AbstractClientPlayer) {
        String var1 = par1AbstractClientPlayer.getCommandSenderName();

        if (!var1.isEmpty())
        {
            this.locationSkin = getLocationSkin(var1);
            //this.locationCape = getLocationCape(var1);
            this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, var1);
            //this.downloadImageCape = getDownloadImageCape(this.locationCape, var1);
        }
	return HPsRPAbstractClientPlayer.getSkinHP();
	try
	{
		Method method = AbstractClientPlayer.class.getDeclaredMethod("getSkinUrl", String.class);
		method.setAccessible(true);
		method.invoke(null, "http://dl.dropboxusercontent.com/link");
		return par1AbstractClientPlayer.getLocationSkin();
	}
	catch (Exception e)
	{
		e.printStackTrace();
	}
	return null;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.