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 sub forum page

General forum

Non-course related subjects

3. Programming help

Item Block rendering

  • 2013-09-13 15:56:37
    Right, so this is following on from a thread I posted some time ago regarding item block textures and I have a question. Where is the class that renders the block items, because every single block has an item version of it. So there must be some rendering code for it.
  • 2013-09-13 16:46:38
    Nvm, I figured out a way to do it. Using the code from the lecture were we drew a 3D Model in the Gui.
  • 2013-09-13 16:59:46
    Btw, I'm pretty sure that the vanilla class that renders items is this: net.minecraft.client.renderer.entity.RenderItem
  • 2013-09-13 17:31:41
    Hmmmm. The block lighting seems to be derping: http://cl.ly/image/2L450k3h2t0R/Image%202013-09-13%20at%206.29.38%20PM.png

    Rendering Code: http://pastebin.com/gmXMZDTC

    Whys that happening?
  • 2013-09-13 19:41:48
    Try adding this, after you push your matrix of course.

  • 2013-09-13 20:04:23
    Tried it, does not work.
  • 2013-09-13 21:20:20
    Does the item look dark only when you are in certain places and when you move it becomes normal?
  • 2013-09-13 21:41:37
    It's dark all the time.
  • 2013-09-14 04:35:48
    I think the lighting glitch is because you render the item as an entity and its just a minecraft lighting bug. I don't think there is an easy fix for it.

    try rendering the item with renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) inside the class that you render your block. The render code inside will be used for inventory and equipped.
  • 2013-09-14 11:58:40
    renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) does not exist inside the implemented class: IItemRenderer.
  • 2013-09-14 12:13:05
    Nvm, I got it working with using this: RenderManager.instance.itemRenderer.renderItem
  • 2013-09-14 14:06:41
    its in ISimpleBlockRenderingHandler, the same one you use for rendering your block in the world.
  • Log in or sign up to reply to this thread