Jump to content

IItemRenderer Not Rendering


SoundLogic

Recommended Posts

I am trying to make a very basic item renderer to work off of, that simply duplicates the vanilla renderer behavior to give me a base to add my stuff to. However, I seem to be failing at even that. My current code is as such:

package SoundLogic.materials.core;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import net.minecraft.client.Minecraft;
import net.minecraft.src.ItemStack;
import net.minecraft.src.RenderEngine;
import net.minecraft.src.Tessellator;
import net.minecraftforge.client.*;

public class HauntedItemRenderer implements IItemRenderer {

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	return type==type.INVENTORY;
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
		ItemRendererHelper helper) {
	return true;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	{
            Tessellator tes = Tessellator.instance;
            ForgeHooksClient.bindTexture(item.getItem().getTextureFile(), 0);
            int var9=item.getIconIndex();
            double texX=var9 % 16 * 16;
            double texY=var9 / 16 * 16;
            tes.startDrawingQuads();
            tes.addVertexWithUV(0, 0, 0, texX, texY);
            tes.addVertexWithUV(0, 16, 0, texX,texY+16);
            tes.addVertexWithUV(16,16,0,texX+16,texY+16);
            tes.addVertexWithUV(16,0,0,texX+16,texY);
            tes.draw();
        }
}
}

I seem to have registered it correctly, since the function is getting called, and I can confirm that the texture and sprite location are valid since it shows up just fine in my hand (which I have not yet implemented a custom renderer for)

If anyone could help me with this I would greatly appreciate it.

Thank you,

Sound Logic

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.

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.