package hmggirlfront.block.tile;
 
import java.util.List;

import hmggirlfront.mod_GirlFront;
import hmggirlfront.entity.EntityDoll;
import hmggirlfront.entity.mob.EntityIBC01;
import hmggirlfront.entity.mob.EntityIBC07;
import hmggirlfront.entity.mob.EntityIBCBase;
import hmggirlfront.entity.mob.EntitySCM_CYCLOPS;
import hmggirlfront.event.level.WorldDifficultyLevel_new;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
 
public class TileEntity_BaseFlag extends TileEntity_BaseBase implements ITickable
{
	
    @Override
	public void update() {
    	Block block = this.world.getBlockState(this.pos).getBlock();
        Entity entity = null;
        int x = this.pos.getX();
        int y= this.pos.getY();
        int z = this.pos.getZ();
        super.update();
        
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_materials
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_materials_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_materials.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_materials_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_materials;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_materials_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_fieldhospital
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_fieldhospital_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_fieldhospital.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_fieldhospital_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_fieldhospital;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_fieldhospital_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_munitionsdepot
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_munitionsdepot_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_munitionsdepot.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_munitionsdepot_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_munitionsdepot;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_munitionsdepot_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_bunker
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_bunker_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_bunker.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_bunker_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_bunker;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_bunker_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_camp
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_camp_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_desert_camp.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_camp_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_desert_camp;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_desert_camp_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_snow_camp.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_snow_camp;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_snow_camp_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp2
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp2_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_snow_camp2.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snow_camp2_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_snow_camp2;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_snow_camp2_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snowforest_camp
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snowforest_camp_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_snowforest_camp.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_snowforest_camp_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_snowforest_camp;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_snowforest_camp_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_helipad.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_helipad;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_helipad_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_substation
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_substation_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_substation.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_substation_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_substation;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_substation_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecollection
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecollection_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_wastecollection.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecollection_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_wastecollection;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_wastecollection_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_de
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_de_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_helipad_de.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_de_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_helipad_de;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_helipad_de_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oilwell
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oilwell_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_oilwell.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oilwell_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_oilwell;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_oilwell_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_mt
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_mt_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_helipad_mt.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_mt_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_helipad_mt;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_helipad_mt_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_coalmine
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_coalmine_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_coalmine.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_coalmine_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_coalmine;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_coalmine_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_se
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_se_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_helipad_se.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_helipad_se_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_helipad_se;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_helipad_se_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecarrier
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecarrier_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_wastecarrier.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_wastecarrier_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_wastecarrier;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_wastecarrier_em;
        	 }
        	 Mob_spawn(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_containership
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_containership_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_containership.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_containership_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_containership;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_containership_em;
        	 }
        	 Mob_spawn_socom(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_offshorecrane
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_offshorecrane_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_offshorecrane.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_offshorecrane_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_offshorecrane;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_offshorecrane_em;
        	 }
        	 Mob_spawn_socom(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_antennabase.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_antennabase;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_antennabase_em;
        	 }
        	 Mob_spawn_socom(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_de
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_de_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_antennabase_de.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_de_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_antennabase_de;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_antennabase_de_em;
        	 }
        	 Mob_spawn_socom(x, y, z, 0);
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_mt
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_mt_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_antennabase_mt.name";
            this.base_boss = false;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_antennabase_mt_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_antennabase_mt;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_antennabase_mt_em;
        	 }
        	 Mob_spawn_socom(x, y, z, 0);
        }
        
        
        
        
        
        
        
        
        
        
        
        
        
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_headquarters
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_headquarters_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_headquarters.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_headquarters_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_headquarters;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_headquarters_em;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 3) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oil_complex
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oil_complex_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_oil_complex.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_oil_complex_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_oil_complex;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_oil_complex_em;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 4) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_forest_base
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_forest_base_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_forest_base.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_forest_base_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_forest_base;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_forest_base_em;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 5) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_base
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_base_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_desert_base.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_desert_base_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_desert_base;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_desert_base_em;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 6) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_amusement
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_amusement_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_amusement.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_amusement_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_amusement;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_amusement_em;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 7) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_observation_base
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_observation_base_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_observation_base.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_observation_base_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_observation_base;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_observation_base;
        	 }
        	 Mob_spawn(x, y, z, 2);
        	 if(mod_GirlFront.difficult_level >= 8) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_sea_launch
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_sea_launch_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_sea_launch.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_sea_launch_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_sea_launch;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_sea_launch_em;
        	 }
        	 Mob_spawn(x, y, z, 2);

        	 if(mod_GirlFront.difficult_level >= 9) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
        
        if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_missile_silo
        		|| this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_missile_silo_em) {
        	this.inv_name = "hmggirlfront.bdoll_base_missile_silo.name";
            this.base_boss = true;
        	 if(this.world.getBlockState(this.pos).getBlock() == mod_GirlFront.bdoll_base_missile_silo_em) {
        		 enemy = true; 
             	invmaxcount = 1200;
                  inv_tex = "inv_m_em.png";
                  enemyblock = true;
                  invclearblock = mod_GirlFront.bdoll_base_missile_silo;
        	 }else {
        		 enemy = false;
            	 invmaxcount = 1200;
                 inv_tex = "inv_m.png";
                 enemyblock = false;
                 invclearblock = mod_GirlFront.bdoll_base_missile_silo_em;
        	 }
        	 Mob_spawn(x, y, z, 2);

        	 if(mod_GirlFront.difficult_level >= 10) {
        		 world_level = true;
        	 }else {
        		 world_level = false;
        	 }
        }
       
        
        if(this.world.getWorldTime() %200 == 0 && !world_level) {
        	int han = 40;
        	int playercount = 0;
        	int mobcount = 0;
        	{
        		AxisAlignedBB axisalignedbb2 = (new AxisAlignedBB((double)(x-han), (double)(y-han), (double)(z-han), 
        				(double)(x + han), (double)(y + han), (double)(z+ han)))
                		.grow(1);
                List llist2 = this.world.getEntitiesWithinAABBExcludingEntity(entity, axisalignedbb2);
                if(llist2!=null){
                    for (int lj = 0; lj < llist2.size(); lj++) {
                    	
                    	Entity entity1 = (Entity)llist2.get(lj);
                    	if (entity1.canBeCollidedWith() && entity1 != null)
                        {
                    		if (entity1 instanceof EntityPlayer) {
                    			EntityPlayer player  = (EntityPlayer) entity1;
                    			if(this.world.isRemote) {
									player.sendMessage(new TextComponentTranslation("hmggirlfront.base.world_level1.name", new Object[0]));
									player.sendMessage(new TextComponentTranslation("hmggirlfront.base.world_level2.name", new Object[0]));
								}
        					}
                        }
                    }
                }
        	}
        }
        
        
	}

    protected void Invation(BlockPos pos) {
    	super.Invation(pos);
    	
    	if(!this.base_boss) {
    		if(mod_GirlFront.difficult_level < 3)WorldDifficultyLevel_new.setLevel(mod_GirlFront.INSTANCE, this.world, 3, "hmggirlfront.cor.level3.name");
    	}
    }
    
    
    
    private void Mob_spawn(int x, int y, int z, int scale) {
    	if(enemy) {
        	++count;
            if(count > 300) {
    			if (this.canspawn(x, y, z, 20) && !this.world.isRemote) {
    				int i = this.world.rand.nextInt(5);
    				if(scale == 2) {
    					 for(int ii = 0; ii < i; ++ii){
    	    		        	int ix = this.world.rand.nextInt(8);
    	    					int iz = this.world.rand.nextInt(8);
    	    					EntityIBC07 entityskeleton = new EntityIBC07(this.world);
    	    		        	entityskeleton.setLocationAndAngles(x - 4 +ix, y+1, z - 4 +iz, 0, 0.0F);
    	    		        	entityskeleton.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc07hg));
    	    		        	entityskeleton.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc07sd));
    	    			        this.world.spawnEntity(entityskeleton);
    	    		        }
    				}else {
    					for(int ii = 0; ii < i; ++ii){
        		        	int ix = this.world.rand.nextInt(8);
        					int iz = this.world.rand.nextInt(8);
        		        	EntityIBC01 entityskeleton = new EntityIBC01(this.world);
        		        	entityskeleton.setLocationAndAngles(x - 4 +ix, y+1, z - 4 +iz, 0, 0.0F);
        			        this.world.spawnEntity(entityskeleton);
        		        }
    				}
    		       
    			}
    			count = 0;
            }
        }
        
    }
    
    private void Mob_spawn_socom(int x, int y, int z, int scale) {
    	if(enemy) {
        	++count;
            if(count > 300) {
    			if (this.canspawn(x, y, z, 20) && !this.world.isRemote) {
    				int i = this.world.rand.nextInt(5);
    				if(scale == 2) {
    					 for(int ii = 0; ii < i; ++ii){
    	    		        	int ix = this.world.rand.nextInt(8);
    	    					int iz = this.world.rand.nextInt(8);
    	    					EntityIBC07 entityskeleton = new EntityIBC07(this.world);
    	    		        	entityskeleton.setLocationAndAngles(x - 4 +ix, y+1, z - 4 +iz, 0, 0.0F);
    	    		        	entityskeleton.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc07hg));
    	    		        	entityskeleton.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc07sd));
    	    			        this.world.spawnEntity(entityskeleton);
    	    		        }
    				}else {
    					for(int ii = 0; ii < i; ++ii){
        		        	int ix = this.world.rand.nextInt(8);
        					int iz = this.world.rand.nextInt(8);
        					EntitySCM_CYCLOPS entityskeleton = new EntitySCM_CYCLOPS(this.world);
        					entityskeleton.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.subarm_ak12prt));
        		        	entityskeleton.setLocationAndAngles(x - 4 +ix, y+1, z - 4 +iz, 0, 0.0F);
        			        this.world.spawnEntity(entityskeleton);
        		        }
    				}
    		       
    			}
    			count = 0;
            }
        }
        
    }
    
}