Jump to content

Dev cape not working


Recommended Posts

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:



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) {

	Minecraft.getMinecraft().renderEngine.loadTexture(location, new ThreadDownloadImageData(null, url.toString(), null, new CapeBuffer()));

public void handlerCape(RenderPlayerEvent.Specials.Pre event) {
	if (event.entityPlayer.getUniqueID().equals(new UUID(you don't need to know my UUID))) {
		((AbstractClientPlayer)event.entityPlayer).func_152121_a(MinecraftProfileTexture.Type.CAPE, location);




public class CapeBuffer implements IImageBuffer {
    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);

        return capeImage;

    public void func_152634_a() {}


Why is my cape white?

Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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