Java Code Examples for net.minecraft.client.renderer.RenderItem#renderItem()
The following examples show how to use
net.minecraft.client.renderer.RenderItem#renderItem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModelPortableBarrel.java From BetterChests with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void render(ItemStack stack, float patrtialTicks) { GlStateManager.pushMatrix(); RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); renderItem.renderItem(stack, parent); InventoryBPortableBarrel barrel = BlocksItemsBetterChests.betterportablebarrel.getInventoryFor(stack, null); if (barrel != null && barrel.getChestPart().isItemSet()) { InventoryPartBarrel part = barrel.getChestPart(); GlStateManager.pushMatrix(); GlStateManager.translate(0, 0, -0.05); GlStateManager.scale(0.8, 0.8, 0.8); renderItem.renderItem(part.getDummy(), TransformType.FIXED); GlStateManager.enableBlend(); GlStateManager.popMatrix(); } GlStateManager.popMatrix(); }
Example 2
Source File: GuiComponentItemStackSpinner.java From OpenModsLib with MIT License | 6 votes |
private void renderItem(ItemStack itemStack) { parent.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); final RenderItem itemRenderer = parent.getItemRenderer(); final ItemModelMesher itemModelMesher = itemRenderer.getItemModelMesher(); final IBakedModel model = itemModelMesher.getItemModel(stack); GlStateManager.disableLighting(); GlStateManager.enableRescaleNormal(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.pushMatrix(); itemRenderer.renderItem(stack, model); GlStateManager.cullFace(CullFace.BACK); GlStateManager.popMatrix(); GlStateManager.disableRescaleNormal(); GlStateManager.disableBlend(); GlStateManager.enableLighting(); }
Example 3
Source File: RenderHelper.java From HoloInventory with MIT License | 6 votes |
public static void renderStack(RenderItem ri, ItemStack stack, int cols, int col, int rows, int row) { GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); GlStateManager.translate(0.4f * (cols / 2.0 - col) - 0.2f, 0.4f * (rows / 2.0 - row), 0); GlStateManager.pushMatrix(); GlStateManager.rotate((float) (360.0 * (double) (System.currentTimeMillis() & 0x3FFFL) / (double) 0x3FFFL), 0, 1, 0); GlStateManager.scale(0.45, 0.45, 0.45); ri.renderItem(stack, ItemCameraTransforms.TransformType.FIXED); if (stack.hasEffect()) { GlStateManager.disableAlpha(); GlStateManager.disableRescaleNormal(); GlStateManager.disableLighting(); } GlStateManager.popMatrix(); GlStateManager.popAttrib(); GlStateManager.popMatrix(); }