Posted July 14, 201411 yr 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:)
July 14, 201411 yr 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.
July 15, 201411 yr Author 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.