Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

The anatomy of a Minecraft model

How to work with and create models for Minecraft

RenderItem

  • 2013-09-25 13:17:09
    So i'm trying to render an EntityItem using RenderItem class, but i'm getting NullPointerException in getEntityTexture method. Any idea why?

    Error:
    http://pastebin.com/izf1gN0i


    Rendering code:

    GL11.glPushMatrix();
            
    GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F + (0.25F / 16F), (float) z + 0.5F);

    GL11.glScalef(0.5F, 0.5F, 0.5F);
            
    ItemStack stack = new ItemStack(Item.appleGold);
    EntityItem entity = new EntityItem(tileentity.worldObj);
    entity.setEntityItemStack(stack);

    renderItem.doRenderItem(entity, 0, 0, 0, 0, 0);        
            
    GL11.glPopMatrix();
  • 2013-09-25 16:02:09
    Fixed, i didn't know you need to do
    renderItem.setRenderManager(RenderManager.instance)
    before using RenderItem.

    If anyone is interested: effects of what i've got so far (rendering an anvil over my block)
    https://www.dropbox.com/s/hm3y86eij9nchdq/2013-09-25_17.58.10.png
  • 2013-09-25 22:25:35
    That looks very interesting :)
  • Log in or sign up to reply to this thread