Posted May 13, 20169 yr I'm trying to make my mod show my optifine cape to people who don't have optifine. However I have this problem: Heres my code: CapeHandler: public class CapeHandler { private static ResourceLocation location = new ResourceLocation("DimCore:cape/Cape"); public static void registerCapeTexture() { URL url = null; try { url = new URL("https://optifine.net/capes/_RadiusOfRift_.png"); } catch (MalformedURLException e) { e.printStackTrace(); } Minecraft.getMinecraft().renderEngine.loadTexture(location, new ThreadDownloadImageData(null, url.toString(), null, new CapeBuffer())); } @SubscribeEvent public void handlerCape(RenderPlayerEvent.Specials.Pre event) { if (event.entityPlayer.getUniqueID().equals(new UUID(you don't need to know my UUID))) { registerCapeTexture(); ((AbstractClientPlayer)event.entityPlayer).func_152121_a(MinecraftProfileTexture.Type.CAPE, location); } } } CapeBuffer: @SideOnly(Side.CLIENT) public class CapeBuffer implements IImageBuffer { @Override public BufferedImage parseUserSkin(BufferedImage texture) { if (texture == null) return null; int imageWidth = texture.getWidth(null) <= 64 ? 64 : texture.getWidth(null); int imageHeight = texture.getHeight(null) <= 32 ? 32 : texture.getHeight(null); BufferedImage capeImage = new BufferedImage(imageWidth, imageHeight, 2); Graphics graphics = capeImage.getGraphics(); graphics.drawImage(texture, 0, 0, null); graphics.dispose(); return capeImage; } @Override public void func_152634_a() {} } Why is my cape white?
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.