package hmggirlfront.render.tile;

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

import hmggirlfront.block.tile.TileEntity_DecoFacingBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
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_DecoFacingBlock extends TileEntitySpecialRenderer<TileEntity_DecoFacingBlock> {
	private static final ResourceLocation tex_laptop = new ResourceLocation("hmggirlfront:textures/blocks/model/laptop_df.png");
	private static final IModelCustom model_laptop = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/laptop_df.mqo"));
	
	private static final ResourceLocation tex_monitor = new ResourceLocation("hmggirlfront:textures/blocks/model/monitor1_df.png");
	private static final IModelCustom model_monitor = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/monitor1_df.mqo"));
	
	private static final ResourceLocation tex_sincgars = new ResourceLocation("hmggirlfront:textures/blocks/model/sincgars_df.png");
	private static final IModelCustom model_sincgars = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/sincgars_df.mqo"));
	
	private static final ResourceLocation tex_toughbook = new ResourceLocation("hmggirlfront:textures/blocks/model/toughbook_df.png");
	private static final IModelCustom model_toughbook = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/toughbook_df.mqo"));
	
	private static final ResourceLocation tex_9mm = new ResourceLocation("hmggirlfront:textures/blocks/model/9mmpack_df.png");
	private static final IModelCustom model_9mm = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/9mmpack_df.mqo"));
	
	private static final ResourceLocation tex_12g = new ResourceLocation("hmggirlfront:textures/blocks/model/12gpack_df.png");
	private static final IModelCustom model_12g = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/12gpack_df.mqo"));
	
	private static final ResourceLocation tex_556 = new ResourceLocation("hmggirlfront:textures/blocks/model/556pack_df.png");
	private static final IModelCustom model_556 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/556pack_df.mqo"));
	
	private static final ResourceLocation tex_collapse_bombe = new ResourceLocation("hmggirlfront:textures/blocks/model/collapse_bombe.png");
	private static final IModelCustom model_collapse_bombe = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/collapse_bombe.mqo"));
	
	private static final ResourceLocation tex_jutebag = new ResourceLocation("hmggirlfront:textures/blocks/model/jutebag_df.png");
	private static final IModelCustom model_jutebag = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/jutebag_df.mqo"));
	
	private static final ResourceLocation tex_medbag = new ResourceLocation("hmggirlfront:textures/blocks/model/medbag_df.png");
	private static final IModelCustom model_medbag = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/medbag_df.mqo"));
	
	
	private static final ResourceLocation tex_416 = new ResourceLocation("hmggirlfront:textures/blocks/model/416nui.png");
	private static final IModelCustom model_416 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/416nui.mqo"));
	
	private static final ResourceLocation tex_g36 = new ResourceLocation("hmggirlfront:textures/blocks/model/g36nui.png");
	private static final IModelCustom model_g36 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/g36nui.mqo"));
	
	private static final ResourceLocation tex_kalin = new ResourceLocation("hmggirlfront:textures/blocks/model/kalinui.png");
	private static final IModelCustom model_kalin = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/kalinui.mqo"));
	
	private static final ResourceLocation tex_mg36 = new ResourceLocation("hmggirlfront:textures/blocks/model/mg36nui.png");
	private static final IModelCustom model_mg36 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/mg36nui.mqo"));
	
	private static final ResourceLocation tex_ro = new ResourceLocation("hmggirlfront:textures/blocks/model/roprowler.png");
	private static final IModelCustom model_ro = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/roprowler.mqo"));
	
	private static final ResourceLocation tex_sopj = new ResourceLocation("hmggirlfront:textures/blocks/model/soptwonui.png");
	private static final IModelCustom model_sopj = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/soptwonui.mqo"));
	
	private static final ResourceLocation tex_wa2000 = new ResourceLocation("hmggirlfront:textures/blocks/model/wa2000nui.png");
	private static final IModelCustom model_wa2000 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/wa2000nui.mqo"));
	
	private static final ResourceLocation tex_rfb = new ResourceLocation("hmggirlfront:textures/blocks/model/rfbnui.png");
	private static final IModelCustom model_rfb = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/rfbnui.mqo"));
	
	
	private static final ResourceLocation tex_57 = new ResourceLocation("hmggirlfront:textures/blocks/model/57pack_df.png");
	private static final IModelCustom model_57 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/57pack_df.mqo"));
	private static final ResourceLocation tex_114 = new ResourceLocation("hmggirlfront:textures/blocks/model/114pack_df.png");
	private static final IModelCustom model_114 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/114pack_df.mqo"));
	private static final ResourceLocation tex_473 = new ResourceLocation("hmggirlfront:textures/blocks/model/473pack_df.png");
	private static final IModelCustom model_473 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/473pack_df.mqo"));
	private static final ResourceLocation tex_762 = new ResourceLocation("hmggirlfront:textures/blocks/model/762pack_df.png");
	private static final IModelCustom model_762 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/762pack_df.mqo"));
	private static final ResourceLocation tex_at = new ResourceLocation("hmggirlfront:textures/blocks/model/at_obstacles2.png");
	private static final IModelCustom model_at = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/at_obstacles2.mqo"));
	private static final ResourceLocation tex_barbed1 = new ResourceLocation("hmggirlfront:textures/blocks/model/barbed1_df.png");
	private static final IModelCustom model_barbed1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/barbed1_df.mqo"));
	private static final ResourceLocation tex_barbed2 = new ResourceLocation("hmggirlfront:textures/blocks/model/barbed2_df.png");
	private static final IModelCustom model_barbed2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/barbed2_df.mqo"));
	private static final ResourceLocation tex_fire_exti = new ResourceLocation("hmggirlfront:textures/blocks/model/fire_exti_df.png");
	private static final IModelCustom model_fire_exti = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/fire_exti_df.mqo"));
	private static final ResourceLocation tex_Jerrycan1 = new ResourceLocation("hmggirlfront:textures/blocks/model/jerrycan1_df.png");
	private static final IModelCustom model_Jerrycan1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/jerrycan1_df.mqo"));
	private static final ResourceLocation tex_mil_cont1 = new ResourceLocation("hmggirlfront:textures/blocks/model/mil_cont1_df.png");
	private static final IModelCustom model_mil_cont1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/mil_cont1_df.mqo"));
	private static final ResourceLocation tex_mil_cont2 = new ResourceLocation("hmggirlfront:textures/blocks/model/mil_cont2_df.png");
	private static final IModelCustom model_mil_cont2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/mil_cont2_df.mqo"));
	private static final ResourceLocation tex_odunit = new ResourceLocation("hmggirlfront:textures/blocks/model/odunit_df.png");
	private static final IModelCustom model_odunit = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/odunit_df.mqo"));
	private static final ResourceLocation tex_sandbag_a1 = new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_a1_df.png");
	private static final IModelCustom model_sandbag_a1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_a1_df.mqo"));
	private static final ResourceLocation tex_sandbag_a2 = new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_a2_df.png");
	private static final IModelCustom model_sandbag_a2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_a2_df.mqo"));
	private static final ResourceLocation tex_sandbag_b2 = new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_b2_df.png");
	private static final IModelCustom model_sandbag_b2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/sandbag_b2_df.mqo"));
	private static final ResourceLocation tex_server_cont1 = new ResourceLocation("hmggirlfront:textures/blocks/model/server_cont1_df.png");
	private static final IModelCustom model_server_cont1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/server_cont1_df.mqo"));
	private static final ResourceLocation tex_server_cont2 = new ResourceLocation("hmggirlfront:textures/blocks/model/server_cont2_df.png");
	private static final IModelCustom model_server_cont2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/server_cont2_df.mqo"));
	private static final ResourceLocation tex_wall1 = new ResourceLocation("hmggirlfront:textures/blocks/model/t_wall1_df.png");
	private static final IModelCustom model_wall1 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/t_wall_df.mqo"));
	private static final ResourceLocation tex_wall2 = new ResourceLocation("hmggirlfront:textures/blocks/model/t_wall2_df.png");
	private static final IModelCustom model_wall2 = AdvancedModelLoader.loadModel(new ResourceLocation("hmggirlfront:textures/blocks/model/t_wall_df.mqo"));
	

	public TileRender_DecoFacingBlock() {
	}

	public void render(TileEntity_DecoFacingBlock 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);
		GL11.glColor4f(1F, 1F, 1F, 1.0F);
		if (tile.facing == 1) {
			GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
		} else if (tile.facing == 2) {
			GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
		} else if (tile.facing == 3) {
			GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
		} else {
			// GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
		}

		if (tile.id == 1) {
			this.bindTexture(tex_monitor);
			model_monitor.renderPart("mat1");
			
		}
		else if (tile.id == 2) {
			this.bindTexture(tex_sincgars);
			model_sincgars.renderPart("mat1");
			
		}
		else if (tile.id == 3) {
			this.bindTexture(tex_toughbook);
			model_toughbook.renderPart("mat1");
			
		} 
		else if (tile.id == 4) {
			this.bindTexture(tex_9mm);
			model_9mm.renderPart("mat1");
			
		} 
		else if (tile.id == 5) {
			this.bindTexture(tex_12g);
			model_12g.renderPart("mat1");
			
		} 
		else if (tile.id == 6) {
			this.bindTexture(tex_556);
			model_556.renderPart("mat1");
			
		} 
		else if (tile.id == 7) {
			this.bindTexture(tex_collapse_bombe);
			model_collapse_bombe.renderPart("mat1");
			
		} 
		else if (tile.id == 10) {
			this.bindTexture(tex_jutebag);
			model_jutebag.renderPart("mat1");
			
		} 
		else if (tile.id == 11) {
			this.bindTexture(tex_medbag);
			model_medbag.renderPart("mat1");
			
		} 
		else if (tile.id == 12) {
			this.bindTexture(tex_416);
			model_416.renderPart("mat1");
			
		} 
		else if (tile.id == 13) {
			this.bindTexture(tex_g36);
			model_g36.renderPart("mat1");
			
		} 
		else if (tile.id == 14) {
			this.bindTexture(tex_kalin);
			model_kalin.renderPart("mat1");
			
		} 
		else if (tile.id == 15) {
			this.bindTexture(tex_mg36);
			model_mg36.renderPart("mat1");
			
		} 
		else if (tile.id == 16) {
			this.bindTexture(tex_ro);
			model_ro.renderPart("mat1");
			
		} 
		else if (tile.id == 17) {
			this.bindTexture(tex_sopj);
			model_sopj.renderPart("mat1");
			
		} 
		else if (tile.id == 18) {
			this.bindTexture(tex_wa2000);
			model_wa2000.renderPart("mat1");
			
		} 
		else if (tile.id == 19) {
			this.bindTexture(tex_rfb);
			model_rfb.renderPart("mat1");
			
		} 
		else if (tile.id == 20) {
			this.bindTexture(tex_57);
			model_57.renderPart("mat1");
			
		} 
		else if (tile.id == 21) {
			this.bindTexture(tex_114);
			model_114.renderPart("mat1");
			
		} 
		else if (tile.id == 22) {
			this.bindTexture(tex_473);
			model_473.renderPart("mat1");
			
		} 
		else if (tile.id == 23) {
			this.bindTexture(tex_762);
			model_762.renderPart("mat1");
			
		} 
		else if (tile.id == 24) {
			this.bindTexture(tex_at);
			model_at.renderPart("mat1");
			
		} 
		else if (tile.id == 25) {
			this.bindTexture(tex_barbed1);
			model_barbed1.renderPart("mat1");
			
		} 
		else if (tile.id == 26) {
			this.bindTexture(tex_barbed2);
			model_barbed2.renderPart("mat1");
			
		} 
		else if (tile.id == 27) {
			this.bindTexture(tex_fire_exti);
			model_fire_exti.renderPart("mat1");
			
		} 
		else if (tile.id == 28) {
			this.bindTexture(tex_Jerrycan1);
			model_Jerrycan1.renderPart("mat1");
			
		} 
		else if (tile.id == 29) {
			this.bindTexture(tex_mil_cont1);
			model_mil_cont1.renderPart("mat1");
			
		} 
		else if (tile.id == 30) {
			this.bindTexture(tex_mil_cont2);
			model_mil_cont2.renderPart("mat1");
			
		} 
		else if (tile.id == 31) {
			this.bindTexture(tex_odunit);
			model_odunit.renderPart("mat1");
			
		} 
		else if (tile.id == 32) {
			this.bindTexture(tex_sandbag_a1);
			model_sandbag_a1.renderPart("mat1");
			
		} 
		else if (tile.id == 33) {
			this.bindTexture(tex_sandbag_a2);
			model_sandbag_a2.renderPart("mat1");
			
		} 
		else if (tile.id == 35) {
			this.bindTexture(tex_sandbag_b2);
			model_sandbag_b2.renderPart("mat1");
			
		} 
		else if (tile.id == 36) {
			this.bindTexture(tex_server_cont1);
			model_server_cont1.renderPart("mat1");
			
		} 
		else if (tile.id == 37) {
			this.bindTexture(tex_server_cont2);
			model_server_cont2.renderPart("mat1");
			
		} 
		else if (tile.id == 38) {
			this.bindTexture(tex_wall1);
			model_wall1.renderPart("mat1");
			
		} 
		else if (tile.id == 39) {
			this.bindTexture(tex_wall2);
			model_wall2.renderPart("mat1");
			
		} 
		else if (tile.id == 0){
			this.bindTexture(tex_laptop);
			model_laptop.renderPart("mat1");
			
		}
		GL11.glDisable(GL12.GL_RESCALE_NORMAL);
		GL11.glPopMatrix();

	}


}