Exemple #1
0
  public boolean func_48135_b(EntityAnimalTFC par1EntityAnimal) {
    if (par1EntityAnimal == this) {
      return false;
    }

    if (par1EntityAnimal.getClass() != getClass()) {
      return false;
    } else {
      return isInLove() && par1EntityAnimal.isInLove() && par1EntityAnimal.sex != sex;
    }
  }
Exemple #2
0
 public void giveBirth(EntityAnimalTFC entityanimal) {
   entityanimal.setGrowingAge(-TFCSettings.dayLength * entityanimal.adultAge);
   // System.out.println("yep");
   // System.out.println(posX);
   entityanimal.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F);
   if (worldObj.spawnEntityInWorld(entityanimal)) {
     children.add(entityanimal);
   }
   if (mateForLife) {
     mate.children.add(entityanimal);
   }
 }
Exemple #3
0
 public void mate(EntityAnimalTFC targetMate) {
   if (sex == 0) {
     targetMate.mate(this);
     return;
   }
   conception = TFCSeasons.getTotalTicks();
   pregnant = true;
   targetMate.setGrowingAge(TFCSettings.dayLength);
   resetInLove();
   targetMate.resetInLove();
   mateSizeMod = targetMate.size_mod;
 }
Exemple #4
0
 public boolean attackEntityfrom(DamageSource par1DamageSource, int par2) {
   Entity entity = par1DamageSource.getEntity();
   fearSource = par1DamageSource.getEntity();
   // System.out.println("yep");
   if (entity.getClass() == getClass() && (((EntityAnimalTFC) entity).rutting)) {
     setAttackTarget((EntityLiving) entity);
     if (getHealth() <= getMaxHealth() / 4) {
       ((EntityAnimalTFC) getAttackTarget()).ruttVictor = true;
     }
   }
   if (isChild()
       && parent.children.contains(this)
       && par1DamageSource.getEntity() instanceof EntityLiving) {
     parent.setAttackTarget((EntityLiving) par1DamageSource.getEntity());
   }
   return super.attackEntityFrom(par1DamageSource, par2);
 }