Posted April 12, 20169 yr Hi, I'm currently updating a mod from 1.7.10 to 1.9 and wish to draw an Item's icon in 2d. Does the current item model system even allow for this? Here is the code I used before: public static void drawItem(ItemStack stack) { if (stack.getItem() instanceof ItemBlock) Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); else Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); IIcon i = stack.getItem().getIcon(stack, 0); Tessellator t = Tessellator.instance; GL11.glPushMatrix(); t.startDrawingQuads(); t.addVertexWithUV(0, 0, 0, i.getMinU(), i.getMinV()); t.addVertexWithUV(1, 0, 0, i.getMaxU(), i.getMinV()); t.addVertexWithUV(1, 1, 0, i.getMaxU(), i.getMaxV()); t.addVertexWithUV(0, 1, 0, i.getMinU(), i.getMaxV()); t.draw(); t.startDrawingQuads(); t.addVertexWithUV(0, 0, 0, i.getMinU(), i.getMinV()); t.addVertexWithUV(0, 1, 0, i.getMinU(), i.getMaxV()); t.addVertexWithUV(1, 1, 0, i.getMaxU(), i.getMaxV()); t.addVertexWithUV(1, 0, 0, i.getMaxU(), i.getMinV()); t.draw(); GL11.glPopMatrix(); } Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
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.