package reborncore.shields.client;

import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelShield;
import net.minecraft.client.renderer.BannerTextures;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityBanner;
import reborncore.shields.CustomShield;


/**
 * Created by Mark on 21/03/2016.
 */
public class RebornItemStackRenderer extends TileEntityItemStackRenderer {

    private TileEntityBanner banner = new TileEntityBanner();
    private ModelShield modelShield = new ModelShield();

    @Override
    public void renderByItem(ItemStack itemStackIn) {
        if (itemStackIn.getItem() == Items.shield) {
            CustomShield sheild = (CustomShield) itemStackIn.getItem();
            if (itemStackIn.getSubCompound("BlockEntityTag", false) != null) {
                banner.setItemValues(itemStackIn);
                Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_DESIGNS.getResourceLocation(banner.getPatternResourceLocation(), banner.getPatternList(), banner.getColorList()));
            } else {
                Minecraft.getMinecraft().getTextureManager().bindTexture(sheild.getShieldTexture(itemStackIn));
            }
            GlStateManager.pushMatrix();
            GlStateManager.scale(1.0F, -1.0F, -1.0F);
            modelShield.render();
            GlStateManager.popMatrix();
            return;
        } else {
            super.renderByItem(itemStackIn);
        }
    }
}

@@ -815,24 +815,82 @@
 s.shield) %7B%0A
+            if(Items.shield instanceof CustomShield)%7B%0A    
             
@@ -953,32 +953,36 @@
 ();%0A            
+ 
+   
 if (itemStackIn.
@@ -1048,16 +1048,20 @@
         
+    
 banner.s
@@ -1079,32 +1079,36 @@
 s(itemStackIn);%0A
+    
                 
@@ -1305,32 +1305,36 @@
 ));%0A            
+    
 %7D else %7B%0A       
@@ -1318,32 +1318,36 @@
        %7D else %7B%0A
+    
                 
@@ -1438,24 +1438,28 @@
 mStackIn));%0A
+    
             
@@ -1464,32 +1464,36 @@
   %7D%0A            
+    
 GlStateManager.p
@@ -1497,32 +1497,36 @@
 r.pushMatrix();%0A
+    
             GlSt
@@ -1575,16 +1575,20 @@
         
+   
+ 
 modelShi
@@ -1597,24 +1597,28 @@
 d.render();%0A
+    
             
@@ -1661,16 +1661,20 @@
     
+    
 return;%0A
     
@@ -1669,16 +1669,100 @@
 return;%0A
+            %7D else %7B%0A                super.renderByItem(itemStackIn);%0A            %7D%0A
         

Fix dev env crash