use of gregtech.common.pipelike.cable.ItemBlockCable in project GregTech by GregTechCE.
the class CableRenderer method renderItem.
@Override
public void renderItem(ItemStack rawItemStack, TransformType transformType) {
ItemStack stack = ModCompatibility.getRealItemStack(rawItemStack);
if (!(stack.getItem() instanceof ItemBlockCable)) {
return;
}
GlStateManager.enableBlend();
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
BlockCable blockCable = (BlockCable) ((ItemBlockCable) stack.getItem()).getBlock();
Insulation insulation = blockCable.getItemPipeType(stack);
Material material = blockCable.getItemMaterial(stack);
if (insulation != null && material != null) {
renderCableBlock(material, insulation, IPipeTile.DEFAULT_INSULATION_COLOR, renderState, new IVertexOperation[0], 1 << EnumFacing.SOUTH.getIndex() | 1 << EnumFacing.NORTH.getIndex() | 1 << (6 + EnumFacing.SOUTH.getIndex()) | 1 << (6 + EnumFacing.NORTH.getIndex()));
}
renderState.draw();
GlStateManager.disableBlend();
}
Aggregations