package hmggirlfront.render.tile;


import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import hmggirlfront.block.tile.TileEntity_ExpBlock;
import hmggirlfront.block.tile.TileEntity_Goods;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import objmodel.AdvancedModelLoader;
import objmodel.IModelCustom;

@SideOnly(Side.CLIENT)
public class TileRender_ExpBlock extends TileEntitySpecialRenderer<TileEntity_ExpBlock>
{
    private static final ResourceLocation tex_ammo = new ResourceLocation("hmggirlfront:textures/blocks/model/ammobox1_df.png");
    private static final IModelCustom model_ammo = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/ammobox1_df.mqo"));
    
    private static final ResourceLocation tex_drum1 = new ResourceLocation("hmggirlfront:textures/blocks/model/barrel_drum1_df.png");
    private static final ResourceLocation tex_drum2 = new ResourceLocation("hmggirlfront:textures/blocks/model/barrel_drum2_df.png");
    private static final IModelCustom model_drum1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/barrel_drum1_df.mqo"));
    
    private static final ResourceLocation tex_ammo2 = new ResourceLocation("hmggirlfront:textures/blocks/model/ammobox2_df.png");
    private static final IModelCustom model_ammo2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/ammobox2_df.mqo"));
    
    private static final ResourceLocation tex_40mm = new ResourceLocation("hmggirlfront:textures/blocks/model/40mmgr_ammo_df.png");
    private static final IModelCustom model_40mm = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/40mmgr_ammo_df.mqo"));
    
    private ResourceLocation texture;
    private boolean field_147509_j;
    private static final String __OBFID = "CL_00000965";

    public TileRender_ExpBlock()
    {
    }

    public void render(TileEntity_ExpBlock tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
    {
    	Minecraft minecraft = Minecraft.getMinecraft();
    	
        GL11.glPushMatrix();
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glTranslatef((float)x + 0.5F, (float)y + 0F, (float)z + 0.5F);
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
        if(tile.id == 1) {
        	this.bindTexture(tex_drum1);
        	model_drum1.renderPart("mat1");
        }
        else if(tile.id == 2) {
        	this.bindTexture(tex_drum2);
        	model_drum1.renderPart("mat1");
        }
        else if(tile.id == 3) {
        	this.bindTexture(tex_40mm);
        	model_40mm.renderPart("mat1");
        }
        else if(tile.id == 4) {
        	this.bindTexture(tex_ammo2);
        	model_ammo2.renderPart("mat1");
        }
        else {
        	this.bindTexture(tex_ammo);
        	model_ammo.renderPart("mat1");
        }
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
        
    }
}