Java 类net.minecraft.entity.EntityLivingData 实例源码

项目:MineFantasy    文件:EntityMinotaur.java   
@Override
public EntityLivingData onSpawnWithEgg(EntityLivingData data)
{
    this.setCanPickUpLoot(false);
    int chance = dimension == -1 ? 150 : 600;
    if(rand.nextInt(chance) < worldObj.difficultySetting && canSetTitan() && getDistanceAway() < cfg.titanDist)
    {
        setTitan();
    }
    else
    {
        if((posY < 32 && !worldObj.canBlockSeeTheSky((int)posX, (int)posY+1, (int)posZ+1)) || dimension == -1)
        {
            setBreed(1);
        }
        else if(isInSnow())
        {
            setBreed(2);
        }
    }
    applyStats();
    this.addRandomItems();

    return super.onSpawnWithEgg(data);
}
项目:MineFantasy    文件:EntityDrake.java   
@Override
  public EntityLivingData onSpawnWithEgg(EntityLivingData data)
  {
double distance = getDistanceAway();

if(distance > getDistanceToSpawn()*3.0F)
{
    setBreed(2);
}
else if(distance > getDistanceToSpawn()*2.0F)
{
    setBreed(1);
}
else
{
    setBreed(0);
}

setAge(100);
if(rand.nextInt(3) == 0)
    setAge(50);

      return super.onSpawnWithEgg(data);
  }
项目:Runes-And-Silver    文件:EntityEskimoZombie.java   
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
{
    super.onKillEntity(par1EntityLivingBase);

    if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager)
    {
        if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
        {
            return;
        }

        EntityEskimoZombie entityzombie = new EntityEskimoZombie(this.worldObj);
        entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
        this.worldObj.removeEntity(par1EntityLivingBase);
        entityzombie.onSpawnWithEgg((EntityLivingData)null);


        this.worldObj.spawnEntityInWorld(entityzombie);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
    }
}
项目:Runes-And-Silver    文件:EntityEskimoZombie.java   
/**
 * Convert this zombie into a villager.
 */
protected void convertToVillager()
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.onSpawnWithEgg((EntityLivingData)null);
    entityvillager.func_82187_q();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.worldObj.removeEntity(this);
    this.worldObj.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
    this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
}
项目:Rediscovered-Mod-1.6.4    文件:EntitySkeletonHorse.java   
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
{
    super.onKillEntity(par1EntityLivingBase);

    if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityHorse)
    {
        if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
        {
            return;
        }

        EntityZombieHorse entityzombie = new EntityZombieHorse(this.worldObj);
        entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
        this.worldObj.removeEntity(par1EntityLivingBase);
        entityzombie.onSpawnWithEgg((EntityLivingData)null);

        this.worldObj.spawnEntityInWorld(entityzombie);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
    }
}
项目:Rediscovered-Mod-1.6.4    文件:EntityZombieHorse.java   
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
{
    super.onKillEntity(par1EntityLivingBase);

    if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityHorse)
    {
        if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
        {
            return;
        }

        EntityZombieHorse entityzombie = new EntityZombieHorse(this.worldObj);
        entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
        this.worldObj.removeEntity(par1EntityLivingBase);
        entityzombie.onSpawnWithEgg((EntityLivingData)null);

        this.worldObj.spawnEntityInWorld(entityzombie);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
    }
}
项目:RuneCraftery    文件:EntitySkeleton.java   
public EntityLivingData func_110161_a(EntityLivingData p_110161_1_) {
   p_110161_1_ = super.func_110161_a(p_110161_1_);
   if(this.field_70170_p.field_73011_w instanceof WorldProviderHell && this.func_70681_au().nextInt(5) > 0) {
      this.field_70714_bg.func_75776_a(4, this.field_85038_e);
      this.func_82201_a(1);
      this.func_70062_b(0, new ItemStack(Item.field_77711_v));
      this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(4.0D);
   } else {
      this.field_70714_bg.func_75776_a(4, this.field_85037_d);
      this.func_82164_bB();
      this.func_82162_bC();
   }

   this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * this.field_70170_p.func_110746_b(this.field_70165_t, this.field_70163_u, this.field_70161_v));
   if(this.func_71124_b(4) == null) {
      Calendar var2 = this.field_70170_p.func_83015_S();
      if(var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.field_70146_Z.nextFloat() < 0.25F) {
         this.func_70062_b(4, new ItemStack(this.field_70146_Z.nextFloat() < 0.1F?Block.field_72008_bf:Block.field_72061_ba));
         this.field_82174_bp[4] = 0.0F;
      }
   }

   return p_110161_1_;
}
项目:RuneCraftery    文件:EntitySpider.java   
public EntityLivingData func_110161_a(EntityLivingData p_110161_1_) {
   Object p_110161_1_1 = super.func_110161_a(p_110161_1_);
   if(this.field_70170_p.field_73012_v.nextInt(100) == 0) {
      EntitySkeleton var2 = new EntitySkeleton(this.field_70170_p);
      var2.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, 0.0F);
      var2.func_110161_a((EntityLivingData)null);
      this.field_70170_p.func_72838_d(var2);
      var2.func_70078_a(this);
   }

   if(p_110161_1_1 == null) {
      p_110161_1_1 = new SpiderEffectsGroupData();
      if(this.field_70170_p.field_73013_u > 2 && this.field_70170_p.field_73012_v.nextFloat() < 0.1F * this.field_70170_p.func_110746_b(this.field_70165_t, this.field_70163_u, this.field_70161_v)) {
         ((SpiderEffectsGroupData)p_110161_1_1).func_111104_a(this.field_70170_p.field_73012_v);
      }
   }

   if(p_110161_1_1 instanceof SpiderEffectsGroupData) {
      int var4 = ((SpiderEffectsGroupData)p_110161_1_1).field_111105_a;
      if(var4 > 0 && Potion.field_76425_a[var4] != null) {
         this.func_70690_d(new PotionEffect(var4, Integer.MAX_VALUE));
      }
   }

   return (EntityLivingData)p_110161_1_1;
}
项目:RuneCraftery    文件:EntityZombie.java   
public void func_70074_a(EntityLivingBase p_70074_1_) {
   super.func_70074_a(p_70074_1_);
   if(this.field_70170_p.field_73013_u >= 2 && p_70074_1_ instanceof EntityVillager) {
      if(this.field_70170_p.field_73013_u == 2 && this.field_70146_Z.nextBoolean()) {
         return;
      }

      EntityZombie var2 = new EntityZombie(this.field_70170_p);
      var2.func_82149_j(p_70074_1_);
      this.field_70170_p.func_72900_e(p_70074_1_);
      var2.func_110161_a((EntityLivingData)null);
      var2.func_82229_g(true);
      if(p_70074_1_.func_70631_g_()) {
         var2.func_82227_f(true);
      }

      this.field_70170_p.func_72838_d(var2);
      this.field_70170_p.func_72889_a((EntityPlayer)null, 1016, (int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, 0);
   }

}
项目:RuneCraftery    文件:ItemMonsterPlacer.java   
public static Entity func_77840_a(World p_77840_0_, int p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) {
   if(!EntityList.field_75627_a.containsKey(Integer.valueOf(p_77840_1_))) {
      return null;
   } else {
      Entity var8 = null;

      for(int var9 = 0; var9 < 1; ++var9) {
         var8 = EntityList.func_75616_a(p_77840_1_, p_77840_0_);
         if(var8 != null && var8 instanceof EntityLivingBase) {
            EntityLiving var10 = (EntityLiving)var8;
            var8.func_70012_b(p_77840_2_, p_77840_4_, p_77840_6_, MathHelper.func_76142_g(p_77840_0_.field_73012_v.nextFloat() * 360.0F), 0.0F);
            var10.field_70759_as = var10.field_70177_z;
            var10.field_70761_aq = var10.field_70177_z;
            var10.func_110161_a((EntityLivingData)null);
            p_77840_0_.func_72838_d(var8);
            var10.func_70642_aH();
         }
      }

      return var8;
   }
}
项目:RuneCraftery    文件:EntityOcelot.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.rand.nextInt(7) == 0)
    {
        for (int i = 0; i < 2; ++i)
        {
            EntityOcelot entityocelot = new EntityOcelot(this.worldObj);
            entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            entityocelot.setGrowingAge(-24000);
            this.worldObj.spawnEntityInWorld(entityocelot);
        }
    }

    return par1EntityLivingData;
}
项目:RuneCraftery    文件:EntityZombie.java   
/**
 * Convert this zombie into a villager.
 */
protected void convertToVillager()
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.onSpawnWithEgg((EntityLivingData)null);
    entityvillager.func_82187_q();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.worldObj.removeEntity(this);
    this.worldObj.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
    this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
}
项目:BetterNutritionMod    文件:EntityOcelot.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.rand.nextInt(7) == 0)
    {
        for (int i = 0; i < 2; ++i)
        {
            EntityOcelot entityocelot = new EntityOcelot(this.worldObj);
            entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            entityocelot.setGrowingAge(-24000);
            this.worldObj.spawnEntityInWorld(entityocelot);
        }
    }

    return par1EntityLivingData;
}
项目:BetterNutritionMod    文件:EntityZombie.java   
/**
 * Convert this zombie into a villager.
 */
protected void convertToVillager()
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.onSpawnWithEgg((EntityLivingData)null);
    entityvillager.func_82187_q();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.worldObj.removeEntity(this);
    this.worldObj.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
    this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
}
项目:MineFantasy    文件:EntitySkeletalKnight.java   
@Override
public EntityLivingData onSpawnWithEgg(EntityLivingData data)
{
    this.setCanPickUpLoot(false);
    enchant(defaultHeldItem);
    enchant(bluntItem);
    enchant(rangedItem);
    enchant(stealthItem);

    return super.onSpawnWithEgg(data);
}
项目:Runes-And-Silver    文件:EskimoSkeletonSpawnerBaseLogic.java   
public Entity func_98265_a(Entity par1Entity)
{

    if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null)
    {
        ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null);
        this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
    }

    return par1Entity;
}
项目:Runes-And-Silver    文件:EntityEskimoSkeleton.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0)
    {
        this.tasks.addTask(4, this.aiAttackOnCollide);
        this.setSkeletonType(1);
        this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone));
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(4.0D);
    }
    else
    {
        this.tasks.addTask(4, this.aiArrowAttack);
        this.addRandomArmor();
        this.enchantEquipment();
    }

    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));

    if (this.getCurrentItemOrArmor(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    return par1EntityLivingData;
}
项目:Runes-And-Silver    文件:EntityEskimoZombie.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData);
    float f = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ);
    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);


    this.addRandomArmor();
    this.enchantEquipment();

    if (this.getCurrentItemOrArmor(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
    this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.rand.nextDouble() * 1.5D, 2));

    if (this.rand.nextFloat() < f * 0.05F)
    {
        this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
    }

    return (EntityLivingData)par1EntityLivingData1;
}
项目:Runes-And-Silver    文件:CustomSpawnerBaseLogic.java   
public Entity func_98265_a(Entity par1Entity)
{

    if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null)
    {
        ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null);
        this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
    }

    return par1Entity;
}
项目:Runes-And-Silver    文件:EskimoZombieSpawnerBaseLogic.java   
public Entity func_98265_a(Entity par1Entity)
{

    if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null)
    {
        ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null);
        this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
    }

    return par1Entity;
}
项目:ZeroQuest    文件:CustomEntityEgg.java   
/**
 * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
 * Parameters: world, entityID, x, y, z.
 */
public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6)
{
    if (!CustomEntityList.entityEggs.containsKey(Integer.valueOf(par1)))
    {
        return null;
    }
    else
    {
        Entity entity = null;

        for (int j = 0; j < 1; ++j)
        {
            entity = CustomEntityList.createEntityByID(par1, par0World);

            if (entity != null && entity instanceof EntityLivingBase)
            {
                EntityLiving entityliving = (EntityLiving)entity;
                entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                entityliving.rotationYawHead = entityliving.rotationYaw;
                entityliving.renderYawOffset = entityliving.rotationYaw;
                entityliving.onSpawnWithEgg((EntityLivingData)null);
                par0World.spawnEntityInWorld(entity);
                entityliving.playLivingSound();
            }
        }

        return entity;
    }
}
项目:CliffiesDecor    文件:ItemDude.java   
/**
 * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
 * Parameters: world, entityID, x, y, z.
 */
public Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6)
{
    {
        Entity entity = null;
        int rand = random.nextInt();

        for (int j = 0; j < 4; ++j)
        {
            //entity = EntityList.createEntityByID(par1, par0World);
            entity = new EntityDude(par0World, this.color, rand);

            //if (entity != null && entity instanceof EntityLivingBase)
            {
                EntityLiving entityliving = (EntityLiving)entity;
                if(j==0)
                    entity.setLocationAndAngles(par2+0.5F, par4, par6+0.5F, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                else if(j==1)
                    entity.setLocationAndAngles(par2-0.5F, par4, par6+0.5F, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                else if(j==2)
                    entity.setLocationAndAngles(par2+0.5F, par4, par6-0.5F, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                else if(j==3)
                    entity.setLocationAndAngles(par2-0.5F, par4, par6-0.5F, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                entityliving.rotationYawHead = entityliving.rotationYaw;
                entityliving.renderYawOffset = entityliving.rotationYaw;
                entityliving.onSpawnWithEgg((EntityLivingData)null);
                EntityDude dude = (EntityDude)entityliving;
                dude.setBatInt(rand);
                dude.setColor(this.color);
                par0World.spawnEntityInWorld(entity);
                entityliving.playLivingSound();
            }
        }

        return entity;
    }
}
项目:CliffiesDecor    文件:ItemMover.java   
/**
 * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
 * Parameters: world, entityID, x, y, z.
 */
public Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6)
{
    {
        Entity entity = null;

        for (int j = 0; j < 1; ++j)
        {
            //entity = EntityList.createEntityByID(par1, par0World);
            entity = new EntityFlag(par0World, this.color, this.batInt);

            //if (entity != null)
            {
                EntityLiving entityliving = (EntityLiving)entity;
                entity.setLocationAndAngles(par2+j, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                entityliving.rotationYawHead = entityliving.rotationYaw;
                entityliving.renderYawOffset = entityliving.rotationYaw;
                entityliving.onSpawnWithEgg((EntityLivingData)null);
                EntityFlag dude = (EntityFlag)entityliving;
                dude.setBatInt(this.batInt);
                dude.setColor(this.color);
                par0World.spawnEntityInWorld(entity);
                entityliving.playLivingSound();
            }
        }

        return entity;
    }
}
项目:Rediscovered-Mod-1.6.4    文件:EntityRangedPigman.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);
    this.tasks.addTask(4, this.aiArrowAttack);
    this.addRandomArmor();
    this.enchantEquipment();

    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));

    return par1EntityLivingData;
}
项目:RuneCraftery    文件:EntityOcelot.java   
public EntityLivingData func_110161_a(EntityLivingData p_110161_1_) {
   p_110161_1_ = super.func_110161_a(p_110161_1_);
   if(this.field_70170_p.field_73012_v.nextInt(7) == 0) {
      for(int var2 = 0; var2 < 2; ++var2) {
         EntityOcelot var3 = new EntityOcelot(this.field_70170_p);
         var3.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, 0.0F);
         var3.func_70873_a(-24000);
         this.field_70170_p.func_72838_d(var3);
      }
   }

   return p_110161_1_;
}
项目:RuneCraftery    文件:EntityZombie.java   
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
   if(!super.func_70097_a(p_70097_1_, p_70097_2_)) {
      return false;
   } else {
      EntityLivingBase var3 = this.func_70638_az();
      if(var3 == null && this.func_70777_m() instanceof EntityLivingBase) {
         var3 = (EntityLivingBase)this.func_70777_m();
      }

      if(var3 == null && p_70097_1_.func_76346_g() instanceof EntityLivingBase) {
         var3 = (EntityLivingBase)p_70097_1_.func_76346_g();
      }

      if(var3 != null && this.field_70170_p.field_73013_u >= 3 && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) {
         int var4 = MathHelper.func_76128_c(this.field_70165_t);
         int var5 = MathHelper.func_76128_c(this.field_70163_u);
         int var6 = MathHelper.func_76128_c(this.field_70161_v);
         EntityZombie var7 = new EntityZombie(this.field_70170_p);

         for(int var8 = 0; var8 < 50; ++var8) {
            int var9 = var4 + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
            int var10 = var5 + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
            int var11 = var6 + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
            if(this.field_70170_p.func_72797_t(var9, var10 - 1, var11) && this.field_70170_p.func_72957_l(var9, var10, var11) < 10) {
               var7.func_70107_b((double)var9, (double)var10, (double)var11);
               if(this.field_70170_p.func_72855_b(var7.field_70121_D) && this.field_70170_p.func_72945_a(var7, var7.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(var7.field_70121_D)) {
                  this.field_70170_p.func_72838_d(var7);
                  var7.func_70624_b(var3);
                  var7.func_110161_a((EntityLivingData)null);
                  this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0));
                  var7.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0));
                  break;
               }
            }
         }
      }

      return true;
   }
}
项目:RuneCraftery    文件:EntityZombie.java   
public EntityLivingData func_110161_a(EntityLivingData p_110161_1_) {
   Object p_110161_1_1 = super.func_110161_a(p_110161_1_);
   float var2 = this.field_70170_p.func_110746_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
   this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * var2);
   if(p_110161_1_1 == null) {
      p_110161_1_1 = new EntityZombieGroupData(this, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, (EntityZombieINNER1)null);
   }

   if(p_110161_1_1 instanceof EntityZombieGroupData) {
      EntityZombieGroupData var3 = (EntityZombieGroupData)p_110161_1_1;
      if(var3.field_142046_b) {
         this.func_82229_g(true);
      }

      if(var3.field_142048_a) {
         this.func_82227_f(true);
      }
   }

   this.func_82164_bB();
   this.func_82162_bC();
   if(this.func_71124_b(4) == null) {
      Calendar var5 = this.field_70170_p.func_83015_S();
      if(var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.field_70146_Z.nextFloat() < 0.25F) {
         this.func_70062_b(4, new ItemStack(this.field_70146_Z.nextFloat() < 0.1F?Block.field_72008_bf:Block.field_72061_ba));
         this.field_82174_bp[4] = 0.0F;
      }
   }

   this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111121_a(new AttributeModifier("Random spawn bonus", this.field_70146_Z.nextDouble() * 0.05000000074505806D, 0));
   this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111121_a(new AttributeModifier("Random zombie-spawn bonus", this.field_70146_Z.nextDouble() * 1.5D, 2));
   if(this.field_70146_Z.nextFloat() < var2 * 0.05F) {
      this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Leader zombie bonus", this.field_70146_Z.nextDouble() * 0.25D + 0.5D, 0));
      this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111121_a(new AttributeModifier("Leader zombie bonus", this.field_70146_Z.nextDouble() * 3.0D + 1.0D, 2));
   }

   return (EntityLivingData)p_110161_1_1;
}
项目:RuneCraftery    文件:EntityZombie.java   
protected void func_82232_p() {
   EntityVillager var1 = new EntityVillager(this.field_70170_p);
   var1.func_82149_j(this);
   var1.func_110161_a((EntityLivingData)null);
   var1.func_82187_q();
   if(this.func_70631_g_()) {
      var1.func_70873_a(-24000);
   }

   this.field_70170_p.func_72900_e(this);
   this.field_70170_p.func_72838_d(var1);
   var1.func_70690_d(new PotionEffect(Potion.field_76431_k.field_76415_H, 200, 0));
   this.field_70170_p.func_72889_a((EntityPlayer)null, 1017, (int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, 0);
}
项目:RuneCraftery    文件:EntitySkeleton.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0)
    {
        this.tasks.addTask(4, this.aiAttackOnCollide);
        this.setSkeletonType(1);
        this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone));
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(4.0D);
    }
    else
    {
        this.tasks.addTask(4, this.aiArrowAttack);
        this.addRandomArmor();
        this.enchantEquipment();
    }

    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));

    if (this.getCurrentItemOrArmor(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    return par1EntityLivingData;
}
项目:RuneCraftery    文件:EntitySpider.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.rand.nextInt(100) == 0)
    {
        EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj);
        entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
        entityskeleton.onSpawnWithEgg((EntityLivingData)null);
        this.worldObj.spawnEntityInWorld(entityskeleton);
        entityskeleton.mountEntity(this);
    }

    if (par1EntityLivingData1 == null)
    {
        par1EntityLivingData1 = new SpiderEffectsGroupData();

        if (this.worldObj.difficultySetting > 2 && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ))
        {
            ((SpiderEffectsGroupData)par1EntityLivingData1).func_111104_a(this.worldObj.rand);
        }
    }

    if (par1EntityLivingData1 instanceof SpiderEffectsGroupData)
    {
        int i = ((SpiderEffectsGroupData)par1EntityLivingData1).field_111105_a;

        if (i > 0 && Potion.potionTypes[i] != null)
        {
            this.addPotionEffect(new PotionEffect(i, Integer.MAX_VALUE));
        }
    }

    return (EntityLivingData)par1EntityLivingData1;
}
项目:RuneCraftery    文件:EntityZombie.java   
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
{
    super.onKillEntity(par1EntityLivingBase);

    if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager)
    {
        if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
        {
            return;
        }

        EntityZombie entityzombie = new EntityZombie(this.worldObj);
        entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
        this.worldObj.removeEntity(par1EntityLivingBase);
        entityzombie.onSpawnWithEgg((EntityLivingData)null);
        entityzombie.setVillager(true);

        if (par1EntityLivingBase.isChild())
        {
            entityzombie.setChild(true);
        }

        this.worldObj.spawnEntityInWorld(entityzombie);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
    }
}
项目:RuneCraftery    文件:ItemMonsterPlacer.java   
/**
 * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
 * Parameters: world, entityID, x, y, z.
 */
public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6)
{
    if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1)))
    {
        return null;
    }
    else
    {
        Entity entity = null;

        for (int j = 0; j < 1; ++j)
        {
            entity = EntityList.createEntityByID(par1, par0World);

            if (entity != null && entity instanceof EntityLivingBase)
            {
                EntityLiving entityliving = (EntityLiving)entity;
                entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                entityliving.rotationYawHead = entityliving.rotationYaw;
                entityliving.renderYawOffset = entityliving.rotationYaw;
                entityliving.onSpawnWithEgg((EntityLivingData)null);
                par0World.spawnEntityInWorld(entity);
                entityliving.playLivingSound();
            }
        }

        return entity;
    }
}
项目:BetterNutritionMod    文件:EntitySkeleton.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0)
    {
        this.tasks.addTask(4, this.aiAttackOnCollide);
        this.setSkeletonType(1);
        this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone));
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(4.0D);
    }
    else
    {
        this.tasks.addTask(4, this.aiArrowAttack);
        this.addRandomArmor();
        this.enchantEquipment();
    }

    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));

    if (this.getCurrentItemOrArmor(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    return par1EntityLivingData;
}
项目:BetterNutritionMod    文件:EntitySpider.java   
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
{
    Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData);

    if (this.worldObj.rand.nextInt(100) == 0)
    {
        EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj);
        entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
        entityskeleton.onSpawnWithEgg((EntityLivingData)null);
        this.worldObj.spawnEntityInWorld(entityskeleton);
        entityskeleton.mountEntity(this);
    }

    if (par1EntityLivingData1 == null)
    {
        par1EntityLivingData1 = new SpiderEffectsGroupData();

        if (this.worldObj.difficultySetting > 2 && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ))
        {
            ((SpiderEffectsGroupData)par1EntityLivingData1).func_111104_a(this.worldObj.rand);
        }
    }

    if (par1EntityLivingData1 instanceof SpiderEffectsGroupData)
    {
        int i = ((SpiderEffectsGroupData)par1EntityLivingData1).field_111105_a;

        if (i > 0 && Potion.potionTypes[i] != null)
        {
            this.addPotionEffect(new PotionEffect(i, Integer.MAX_VALUE));
        }
    }

    return (EntityLivingData)par1EntityLivingData1;
}
项目:BetterNutritionMod    文件:EntityZombie.java   
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
{
    super.onKillEntity(par1EntityLivingBase);

    if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager)
    {
        if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
        {
            return;
        }

        EntityZombie entityzombie = new EntityZombie(this.worldObj);
        entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
        this.worldObj.removeEntity(par1EntityLivingBase);
        entityzombie.onSpawnWithEgg((EntityLivingData)null);
        entityzombie.setVillager(true);

        if (par1EntityLivingBase.isChild())
        {
            entityzombie.setChild(true);
        }

        this.worldObj.spawnEntityInWorld(entityzombie);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
    }
}
项目:BetterNutritionMod    文件:ItemMonsterPlacer.java   
/**
 * Spawns the creature specified by the egg's type in the location specified by the last three parameters.
 * Parameters: world, entityID, x, y, z.
 */
public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6)
{
    if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1)))
    {
        return null;
    }
    else
    {
        Entity entity = null;

        for (int j = 0; j < 1; ++j)
        {
            entity = EntityList.createEntityByID(par1, par0World);

            if (entity != null && entity instanceof EntityLivingBase)
            {
                EntityLiving entityliving = (EntityLiving)entity;
                entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
                entityliving.rotationYawHead = entityliving.rotationYaw;
                entityliving.renderYawOffset = entityliving.rotationYaw;
                entityliving.onSpawnWithEgg((EntityLivingData)null);
                par0World.spawnEntityInWorld(entity);
                entityliving.playLivingSound();
            }
        }

        return entity;
    }
}
项目:BetterNutritionMod    文件:VillageSiege.java   
private boolean spawnZombie()
{
    Vec3 vec3 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i);

    if (vec3 == null)
    {
        return false;
    }
    else
    {
        EntityZombie entityzombie;

        try
        {
            entityzombie = new EntityZombie(this.worldObj);
            entityzombie.onSpawnWithEgg((EntityLivingData)null);
            entityzombie.setVillager(false);
        }
        catch (Exception exception)
        {
            exception.printStackTrace();
            return false;
        }

        entityzombie.setLocationAndAngles(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.worldObj.rand.nextFloat() * 360.0F, 0.0F);
        this.worldObj.spawnEntityInWorld(entityzombie);
        ChunkCoordinates chunkcoordinates = this.theVillage.getCenter();
        entityzombie.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this.theVillage.getVillageRadius());
        return true;
    }
}
项目:ZeroQuest    文件:ItemCage.java   
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {


    if(par1ItemStack.getTagCompound() != null && 
            par1ItemStack.getTagCompound().hasKey(ModEntities.tag)){
        if(!(par1ItemStack.getTagCompound().getString(ModEntities.tag).equals("none"))){


            //create an entity from String.
            Entity entity = CustomEntityList.createEntityByName(par1ItemStack.getTagCompound().getString(ModEntities.tag), par3World);


            //remove that string so it doesnt slip in the new entity
            par1ItemStack.getTagCompound().removeTag(ModEntities.tag);


            FMLLog.getLogger().info("" + par1ItemStack.getTagCompound());
            if(entity != null){
                if(entity instanceof EntityAnimal){
                    EntityAnimal storedAnimal = (EntityAnimal)entity;


                    storedAnimal.readEntityFromNBT(par1ItemStack.getTagCompound());

                    storedAnimal.setLocationAndAngles(par4, par5, par6, MathHelper.wrapAngleTo180_float(par3World.rand.nextFloat() * 360.0F), 0.0F);
                    storedAnimal.rotationYawHead = storedAnimal.rotationYaw;
                    storedAnimal.renderYawOffset = storedAnimal.rotationYaw;
                    storedAnimal.onSpawnWithEgg((EntityLivingData)null);
                    storedAnimal.playLivingSound();
                    if(!par2EntityPlayer.worldObj.isRemote)
                        par3World.spawnEntityInWorld(entity);
                    par1ItemStack.getTagCompound().setString(ModEntities.tag, "none");
                    animalCompound = new NBTTagCompound();
                    par1ItemStack.setTagCompound(animalCompound);
                }
            }
        }else{
            if(!par2EntityPlayer.worldObj.isRemote)
                par2EntityPlayer.addChatMessage("The Animal Trap is empty ... ");
            animalCompound = new NBTTagCompound();
            par1ItemStack.setTagCompound(animalCompound);
        }
    }else{
        if(!par2EntityPlayer.worldObj.isRemote)
            par2EntityPlayer.addChatMessage("The Animal Trap is empty ... ");
        animalCompound = new NBTTagCompound();
        par1ItemStack.setTagCompound(animalCompound);
    }




    return true;
}
项目:Rediscovered-Mod-1.6.4    文件:EntityGreenVillager.java   
public EntityVillager func_90012_b(EntityAgeable par1EntityAgeable)
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.onSpawnWithEgg((EntityLivingData)null);
    return entityvillager;
}
项目:RuneCraftery    文件:SpawnerAnimals.java   
public static void func_77191_a(World p_77191_0_, BiomeGenBase p_77191_1_, int p_77191_2_, int p_77191_3_, int p_77191_4_, int p_77191_5_, Random p_77191_6_) {
   List var7 = p_77191_1_.func_76747_a(EnumCreatureType.creature);
   if(!var7.isEmpty()) {
      while(p_77191_6_.nextFloat() < p_77191_1_.func_76741_f()) {
         SpawnListEntry var8 = (SpawnListEntry)WeightedRandom.func_76271_a(p_77191_0_.field_73012_v, var7);
         EntityLivingData var9 = null;
         int var10 = var8.field_76301_c + p_77191_6_.nextInt(1 + var8.field_76299_d - var8.field_76301_c);
         int var11 = p_77191_2_ + p_77191_6_.nextInt(p_77191_4_);
         int var12 = p_77191_3_ + p_77191_6_.nextInt(p_77191_5_);
         int var13 = var11;
         int var14 = var12;

         for(int var15 = 0; var15 < var10; ++var15) {
            boolean var16 = false;

            for(int var17 = 0; !var16 && var17 < 4; ++var17) {
               int var18 = p_77191_0_.func_72825_h(var11, var12);
               if(func_77190_a(EnumCreatureType.creature, p_77191_0_, var11, var18, var12)) {
                  float var19 = (float)var11 + 0.5F;
                  float var20 = (float)var18;
                  float var21 = (float)var12 + 0.5F;

                  EntityLiving var22;
                  try {
                     var22 = (EntityLiving)var8.field_76300_b.getConstructor(new Class[]{World.class}).newInstance(new Object[]{p_77191_0_});
                  } catch (Exception var24) {
                     var24.printStackTrace();
                     continue;
                  }

                  var22.func_70012_b((double)var19, (double)var20, (double)var21, p_77191_6_.nextFloat() * 360.0F, 0.0F);
                  p_77191_0_.func_72838_d(var22);
                  var9 = var22.func_110161_a(var9);
                  var16 = true;
               }

               var11 += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5);

               for(var12 += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); var11 < p_77191_2_ || var11 >= p_77191_2_ + p_77191_4_ || var12 < p_77191_3_ || var12 >= p_77191_3_ + p_77191_4_; var12 = var14 + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5)) {
                  var11 = var13 + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5);
               }
            }
         }
      }

   }
}