use of gregtech.api.metatileentity.IRenderMetaTileEntity in project GregTech by GregTechCE.
the class MetaTileEntityRenderer method renderItem.
@Override
public void renderItem(ItemStack rawStack, TransformType transformType) {
ItemStack stack = ModCompatibility.getRealItemStack(rawStack);
if (!(stack.getItem() instanceof MachineItemBlock)) {
return;
}
MetaTileEntity metaTileEntity = MachineItemBlock.getMetaTileEntity(stack);
if (metaTileEntity == null) {
return;
}
GlStateManager.enableBlend();
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
metaTileEntity.setRenderContextStack(stack);
metaTileEntity.renderMetaTileEntity(renderState, new Matrix4(), new IVertexOperation[0]);
if (metaTileEntity instanceof IFastRenderMetaTileEntity) {
((IFastRenderMetaTileEntity) metaTileEntity).renderMetaTileEntityFast(renderState, new Matrix4(), 0.0f);
}
metaTileEntity.setRenderContextStack(null);
renderState.draw();
if (metaTileEntity instanceof IRenderMetaTileEntity) {
((IRenderMetaTileEntity) metaTileEntity).renderMetaTileEntityDynamic(0.0, 0.0, 0.0, 0.0f);
}
GlStateManager.disableBlend();
}
Aggregations