package ljfa.glassshards.render;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;

public class TransparentItemRenderer implements IItemRenderer {

    @Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
        return type == ItemRenderType.ENTITY;
    }

    @Override
    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
        return helper == ItemRendererHelper.ENTITY_BOBBING
                || helper == ItemRendererHelper.ENTITY_ROTATION;
    }

    @Override
    public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
        if(type == ItemRenderType.ENTITY) {
            //RenderBlocks render = (RenderBlocks)data[0];
            //EntityItem entity = (EntityItem)data[1];
            
            IIcon icon = item.getIconIndex();
            
            float f = icon.getMinU();
            float f1 = icon.getMaxU();
            float f2 = icon.getMinV();
            float f3 = icon.getMaxV();
            
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625f);
        }
    }
}

@@ -38,31 +38,39 @@
 ort 
-org.lwjgl.opengl.GL11;%0A
+net.minecraft.client.Minecraft;
 %0Aimp
@@ -154,28 +154,27 @@
 enderer.
-RenderBlocks
+Tessellator
 ;%0Aimport
@@ -208,60 +208,21 @@
 rer.
-Tessellator;%0Aimport net.minecraft.entity.item.Entity
+entity.Render
 Item
@@ -342,16 +342,47 @@
 derer;%0A%0A
+import org.lwjgl.opengl.GL11;%0A%0A
 public c
@@ -437,16 +437,20 @@
 derer %7B%0A
+    
 %0A    @Ov
@@ -550,37 +550,216 @@
 urn 
-type == ItemRenderType.ENTITY
+Minecraft.getMinecraft().gameSettings.fancyGraphics &&%0A               (type == ItemRenderType.ENTITY%0A            %7C%7C type == ItemRenderType.EQUIPPED%0A            %7C%7C type == ItemRenderType.EQUIPPED_FIRST_PERSON)
 ;%0A  
@@ -955,20 +955,16 @@
         
- 
-   
 %7C%7C helpe
@@ -1006,128 +1006,92 @@
 TION
-;
 %0A    
-%7D%0A%0A
     
-@Override%0A    public void renderItem(ItemRenderType type, ItemStack item, Object... data) %7B%0A        if(ty
+    %7C%7C type == ItemRenderType.ENTITY && !RenderItem.renderInFrame && hel
 pe
+r
  == 
@@ -1104,154 +1104,130 @@
 nder
-Type.ENTITY) %7B
+erHelper.BLOCK_3D;
 %0A    
+%7D%0A%0A
     
-    //RenderBlocks render = (RenderBlocks)data%5B0%5D;%0A            //EntityItem entity = (EntityItem)data%5B1%5D;%0A            %0A    
+@Override%0A    public void renderItem(ItemRenderType type, ItemStack item, Object... data) %7B%0A
     
@@ -1272,31 +1272,25 @@
         
-    %0A  
+%0A
         
   float 
@@ -1281,25 +1281,26 @@
         
-  
 float 
-f
+minU
  = icon.
@@ -1306,28 +1306,24 @@
 .getMinU();%0A
-    
         floa
@@ -1324,18 +1324,20 @@
   float 
-f1
+maxU
  = icon.
@@ -1359,20 +1359,18 @@
     
-    
 float 
-f2
+minV
  = i
@@ -1396,20 +1396,18 @@
     
-    
 float 
-f3
+maxV
  = i
@@ -1433,59 +1433,179 @@
     
+%0A
     
-%0A            GL11.glEnable(GL11.GL_BLEND);%0A    
+    if(type == ItemRenderType.ENTITY) %7B%0A            GL11.glTranslatef(-0.5f, -0.25f, 0.0421875f);%0A        %7D%0A        %0A        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);%0A
     
@@ -1674,24 +1674,58 @@
 ALPHA);%0A    
+    GL11.glEnable(GL11.GL_BLEND);%0A
         Item
@@ -1774,21 +1774,30 @@
 ce, 
-f1, f2, f, f3
+maxU, minV, minU, maxV
 , ic
@@ -1843,30 +1843,20 @@
 , 0.0625f);%0A
-        %7D%0A
     %7D%0A%7D%0A

Add to the renderer