package hmggirlfront.items;

import hmggirlfront.mod_GirlFront;
import hmggirlfront.entity.EntityKalina;
import hmggirlfront.entity.mob.EntityELID_SKELETEN;
import hmggirlfront.entity.mob.EntityELID_ZOMBIE;
import hmggirlfront.entity.mob.EntityIBC01;
import hmggirlfront.entity.mob.EntityIBC01Turret;
import hmggirlfront.entity.mob.EntityIBC02;
import hmggirlfront.entity.mob.EntityIBC03;
import hmggirlfront.entity.mob.EntityIBC04;
import hmggirlfront.entity.mob.EntityIBC05;
import hmggirlfront.entity.mob.EntityIBC06;
import hmggirlfront.entity.mob.EntityIBC07;
import hmggirlfront.entity.mob.EntityIBC08;
import hmggirlfront.entity.mob.EntityIBC09;
import hmggirlfront.entity.mob.EntityIBC10;
import hmggirlfront.entity.mob.EntityIBC10Turret;
import hmggirlfront.entity.mob.EntityIBC11;
import hmggirlfront.entity.mob.EntityIBC12;
import hmggirlfront.entity.mob.EntityIBC13;
import hmggirlfront.entity.mob.EntityIBC14;
import hmggirlfront.entity.mob.EntityIBCBoss01;
import hmggirlfront.entity.mob.EntityIBCBoss02;
import hmggirlfront.entity.mob.EntityIBCBoss03;
import hmggirlfront.entity.mob.EntityIBCBoss04;
import hmggirlfront.entity.mob.EntityIBCBoss05;
import hmggirlfront.entity.mob.EntityIBCBoss06;
import hmggirlfront.entity.mob.EntityIBCBoss07;
import hmggirlfront.entity.mob.EntityIBCBoss08;
import hmggirlfront.entity.mob.EntityIBCGENE;
import hmggirlfront.entity.mob.EntityIBCJUPITER;
import hmggirlfront.entity.mob.EntitySCM_AEGIS;
import hmggirlfront.entity.mob.EntitySCM_CERYNITIS;
import hmggirlfront.entity.mob.EntitySCM_CYCLOPS;
import hmggirlfront.entity.mob.EntitySCM_HYDRA;
import hmggirlfront.entity.mob.paradeus.EntityPDS_NYTO_EOT1;
import hmggirlfront.entity.mob.paradeus.EntityPDS_NYTO_N;
import hmggirlfront.entity.mob.paradeus.EntityPDS_NYTO_O;
import hmggirlfront.entity.mob.paradeus.EntityPDS_NYTO_P;
import hmggirlfront.entity.vehicle.EntityVe_APC;
import hmggirlfront.entity.vehicle.EntityVe_BIKE;
import hmggirlfront.entity.vehicle.EntityVe_CB90;
import hmggirlfront.entity.vehicle.EntityVe_HMMWV;
import hmggirlfront.entity.vehicle.EntityVe_Heli;
import hmggirlfront.entity.vehicle.EntityVe_IFV;
import hmggirlfront.entity.vehicle.EntityVe_RHIB;
import hmggirlfront.entity.vehicle.EntityVe_TRUCK;
import hmggirlfront.world.WorldDifficultyLevel;
import net.minecraft.block.BlockLiquid;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;

public class ItemSpawn_IBC extends Item
{
	public int ii;
	
	//public String nameid = null;
	
	public int id = 0;
	
    public ItemSpawn_IBC(int i)
    {
        this.maxStackSize = 1;
        this.id = i;
    }

    public void spawnCreature(World worldIn, EntityPlayer playerIn, double par4, double par5, double par6)
    {

		if (this.id == 1) {
			//for(int ii = 0; ii < 40; ++ii)
			{
				++par5;
				int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
				EntityIBC01 ent = new EntityIBC01(worldIn);
				ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
				ent.setcanDespawn(1);
				worldIn.spawnEntity(ent);
			}
			
		} 
		else if (this.id == 2) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC02 ent = new EntityIBC02(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 3) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC03 ent = new EntityIBC03(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 4) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC04 ent = new EntityIBC04(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc04smg));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc04smg));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 5) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC05 ent = new EntityIBC05(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc05ar));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 6) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC06 ent = new EntityIBC06(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc06rf));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 7) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC07 ent = new EntityIBC07(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc07hg));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc07sd));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 8) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC08 ent = new EntityIBC08(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc08sw));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc08sd));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 9) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC09 ent = new EntityIBC09(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 10) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC10 ent = new EntityIBC10(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 11) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC11 ent = new EntityIBC11(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 12) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC12 ent = new EntityIBC12(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 13) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC13 ent = new EntityIBC13(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc13glg));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 14) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC14 ent = new EntityIBC14(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc14sw));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc14sw));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 32) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC01Turret ent = new EntityIBC01Turret(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		} 
		else if (this.id == 33) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBC10Turret ent = new EntityIBC10Turret(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		} 
		else if (this.id == 35) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCJUPITER ent = new EntityIBCJUPITER(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		} 
		else if (this.id == 36) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCGENE ent = new EntityIBCGENE(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		} 
		
		else if (this.id == 101) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss01 ent = new EntityIBCBoss01(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 102) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss02 ent = new EntityIBCBoss02(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss02sw));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss02hg));
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 103) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss03 ent = new EntityIBCBoss03(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss02hg));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss02hg));
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 104) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss04 ent = new EntityIBCBoss04(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss04glg));
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 105) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss05 ent = new EntityIBCBoss05(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 106) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss06 ent = new EntityIBCBoss06(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 107) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss07 ent = new EntityIBCBoss07(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibcboss07rf));
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 108) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityIBCBoss08 ent = new EntityIBCBoss08(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		
		else if (this.id == 151) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntitySCM_CYCLOPS ent = new EntitySCM_CYCLOPS(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.subarm_ak12prt));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 152) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntitySCM_AEGIS ent = new EntitySCM_AEGIS(worldIn);
			ent.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(mod_GirlFront.dollgun_ibc08sw));
			ent.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, new ItemStack(mod_GirlFront.dollgun_ibc08sd));
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 153) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntitySCM_CERYNITIS ent = new EntitySCM_CERYNITIS(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 154) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntitySCM_HYDRA ent = new EntitySCM_HYDRA(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		
		
		else if (this.id == 181) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityELID_ZOMBIE ent = new EntityELID_ZOMBIE(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 182) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityELID_SKELETEN ent = new EntityELID_SKELETEN(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		
		
		
		else if (this.id == 501) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityPDS_NYTO_O ent = new EntityPDS_NYTO_O(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 502) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityPDS_NYTO_P ent = new EntityPDS_NYTO_P(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 503) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityPDS_NYTO_N ent = new EntityPDS_NYTO_N(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 504) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityPDS_NYTO_EOT1 ent = new EntityPDS_NYTO_EOT1(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		
		
		
		else if (this.id == 200) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityKalina ent = new EntityKalina(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
			/*if(mod_GirlFront.difficult_level < 2) {
				//playerIn.sendMessage(new TextComponentTranslation("Cancellation of restriction-2", new Object[0]));
				WorldDifficultyLevel.setLevel(mod_GirlFront.INSTANCE, worldIn, 2, ent, "hmggirlfront.cor.level2.name");
			}*/
		}
		else if (this.id == 199) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityKalina ent = new EntityKalina(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			ent.setArmID_A(1);
			worldIn.spawnEntity(ent);
			/*if(mod_GirlFront.difficult_level < 2) {
				//playerIn.sendMessage(new TextComponentTranslation("Cancellation of restriction-2", new Object[0]));
				WorldDifficultyLevel.setLevel(mod_GirlFront.INSTANCE, worldIn, 2, ent, "hmggirlfront.cor.level2.name");
			}*/
		}
		else if (this.id == 198) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityKalina ent = new EntityKalina(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			ent.setArmID_A(2);
			worldIn.spawnEntity(ent);
			/*if(mod_GirlFront.difficult_level < 2) {
				//playerIn.sendMessage(new TextComponentTranslation("Cancellation of restriction-2", new Object[0]));
				WorldDifficultyLevel.setLevel(mod_GirlFront.INSTANCE, worldIn, 2, ent, "hmggirlfront.cor.level2.name");
			}*/
		}
		else if (this.id == 195) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityKalina ent = new EntityKalina(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			ent.setArmID_A(3);
			worldIn.spawnEntity(ent);
			/*if(mod_GirlFront.difficult_level < 2) {
				//playerIn.sendMessage(new TextComponentTranslation("Cancellation of restriction-2", new Object[0]));
				WorldDifficultyLevel.setLevel(mod_GirlFront.INSTANCE, worldIn, 2, ent, "hmggirlfront.cor.level2.name");
			}*/
		}
		else if (this.id == 194) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityKalina ent = new EntityKalina(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			ent.setArmID_A(4);
			worldIn.spawnEntity(ent);
			/*if(mod_GirlFront.difficult_level < 2) {
				//playerIn.sendMessage(new TextComponentTranslation("Cancellation of restriction-2", new Object[0]));
				WorldDifficultyLevel.setLevel(mod_GirlFront.INSTANCE, worldIn, 2, ent, "hmggirlfront.cor.level2.name");
			}*/
		}
		else if (this.id == 300) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_Heli ent = new EntityVe_Heli(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 301) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_APC ent = new EntityVe_APC(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 302) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_BIKE ent = new EntityVe_BIKE(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 303) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_IFV ent = new EntityVe_IFV(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 304) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_TRUCK ent = new EntityVe_TRUCK(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 305) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_HMMWV ent = new EntityVe_HMMWV(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 306) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_RHIB ent = new EntityVe_RHIB(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		else if (this.id == 307) {
			++par5;
			int var12 = MathHelper.floor((double) (playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
			EntityVe_CB90 ent = new EntityVe_CB90(worldIn);
			ent.setLocationAndAngles(par4 + 0.5, par5, par6 + 0.5, var12, 0.0F);
			ent.setcanDespawn(1);
			worldIn.spawnEntity(ent);
		}
		
	}
    
    public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
		ItemStack itemStackIn = player.getHeldItem(hand);
		int par4 = pos.getX();
		int par5 = pos.getY();
		int par6 = pos.getZ();
		
		if (worldIn.isRemote)
        {
			return EnumActionResult.PASS;
        }
        else
		{
        	if (!player.capabilities.isCreativeMode)
            {
        		itemStackIn.shrink(1);
            }
        	spawnCreature(worldIn, player, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
        	return EnumActionResult.PASS;
        }
    }
	
	/**
     * Called when the equipped item is right clicked.
     */
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
    {
    	ItemStack itemStackIn = playerIn.getHeldItem(handIn);
        if (worldIn.isRemote)
        {
            return new ActionResult(EnumActionResult.PASS, itemStackIn);
        }
        else
        {
            RayTraceResult raytraceresult = this.rayTrace(worldIn, playerIn, true);

            if (raytraceresult != null && raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK)
            {
                BlockPos blockpos = raytraceresult.getBlockPos();

                if (!(worldIn.getBlockState(blockpos).getBlock() instanceof BlockLiquid))
                {
                    return new ActionResult(EnumActionResult.PASS, itemStackIn);
                }
                else if (worldIn.isBlockModifiable(playerIn, blockpos) && playerIn.canPlayerEdit(blockpos, raytraceresult.sideHit, itemStackIn))
                {
                    spawnCreature(worldIn, playerIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
                    {

                    	if (!playerIn.capabilities.isCreativeMode)
                        {
                    		itemStackIn.shrink(1);
                        }

                        playerIn.addStat(StatList.getObjectUseStats(this));
                        return new ActionResult(EnumActionResult.SUCCESS, itemStackIn);
                    }
                }
                else
                {
                    return new ActionResult(EnumActionResult.FAIL, itemStackIn);
                }
            }
            else
            {
                return new ActionResult(EnumActionResult.PASS, itemStackIn);
            }
        }
    }
}