package de.comeight.crystallogy.renderer;

import de.comeight.crystallogy.tileEntitys.TileEnityInfuserBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RendererInfuserBlockItem extends TileEntitySpecialRenderer<TileEnityInfuserBlock>
{
	//-----------------------------------------------Variabeln:---------------------------------------------
	
	
	//-----------------------------------------------Constructor:-------------------------------------------

	
	//-----------------------------------------------Set-, Get-Methoden:------------------------------------

	
	//-----------------------------------------------Sonstige Methoden:-------------------------------------
    @Override
    public void renderTileEntityAt(TileEnityInfuserBlock tileInfuserBlock, double x, double y, double z, float partialTicks, int destroyStage)
    {
        ItemStack inputStack = tileInfuserBlock.getStackInSlot(0);

        GlStateManager.pushMatrix();
        GlStateManager.translate(x, y, z);
        renderItem(inputStack);
        GlStateManager.popMatrix();
    }

    private void renderItem(ItemStack stack)
    {
        RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
        if (stack != null)
        {
            GlStateManager.translate(0.5, 0.7, 0.5);
            GlStateManager.pushMatrix();
            GlStateManager.disableLighting();

            float rotationAngel = (float) (720.0 * (System.currentTimeMillis() / 2 & 0x3FFFL) / 0x3FFFL);

            GlStateManager.rotate(rotationAngel, 0.0F, 1.0F, 0.0F);
            GlStateManager.pushAttrib();
            RenderHelper.enableStandardItemLighting();
            itemRenderer.renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
            RenderHelper.disableStandardItemLighting();
            GlStateManager.popAttrib();
            GlStateManager.enableLighting();
            GlStateManager.popMatrix();
        }
    }
}
@@ -1753,75 +1753,205 @@
 ger.
-translate(0.5, 0.7, 0.5);%0D%0A            GlStateManager.pushMatrix();
+pushMatrix();%0D%0A            %0D%0A            GlStateManager.disableLighting();%0D%0A            RenderHelper.enableStandardItemLighting();%0D%0A            GlStateManager.color(1.0F, 1.0F, 1.0F);%0D%0A            
 %0D%0A  
@@ -1975,36 +1975,41 @@
 Manager.
-disableLighting();%0D%0A
+translate(0.5, 0.7, 0.5);
 %0D%0A      
@@ -2105,26 +2105,24 @@
  0x3FFFL);%0D%0A
-%0D%0A
             
@@ -2194,92 +2194,8 @@
     
-GlStateManager.pushAttrib();%0D%0A            RenderHelper.enableStandardItemLighting();
 %0D%0A  
@@ -2276,24 +2276,38 @@
 e.GROUND);%0D%0A
+            %0D%0A
             
@@ -2355,49 +2355,8 @@
 );%0D%0A
-            GlStateManager.popAttrib();%0D%0A
     
@@ -2389,32 +2389,46 @@
 bleLighting();%0D%0A
+            %0D%0A
             GlSt

Clean up