Example #1
0
  public EntityAgeable createChild(EntityAgeable entityageable) {
    EntityHorse entityhorse = (EntityHorse) entityageable;
    EntityHorse entityhorse1 = new EntityHorse(this.world);
    int i = this.getType();
    int j = entityhorse.getType();
    int k = 0;

    if (i == j) {
      k = i;
    } else if (i == 0 && j == 1 || i == 1 && j == 0) {
      k = 2;
    }

    if (k == 0) {
      int l = this.random.nextInt(9);
      int i1;

      if (l < 4) {
        i1 = this.getVariant() & 255;
      } else if (l < 8) {
        i1 = entityhorse.getVariant() & 255;
      } else {
        i1 = this.random.nextInt(7);
      }

      int j1 = this.random.nextInt(5);

      if (j1 < 2) {
        i1 |= this.getVariant() & '\uff00';
      } else if (j1 < 4) {
        i1 |= entityhorse.getVariant() & '\uff00';
      } else {
        i1 |= this.random.nextInt(5) << 8 & '\uff00';
      }

      entityhorse1.setVariant(i1);
    }

    entityhorse1.setType(k);
    double d0 =
        this.getAttributeInstance(GenericAttributes.a).b()
            + entityageable.getAttributeInstance(GenericAttributes.a).b()
            + (double) this.cV();

    entityhorse1.getAttributeInstance(GenericAttributes.a).setValue(d0 / 3.0D);
    double d1 =
        this.getAttributeInstance(attributeJumpStrength).b()
            + entityageable.getAttributeInstance(attributeJumpStrength).b()
            + this.cW();

    entityhorse1.getAttributeInstance(attributeJumpStrength).setValue(d1 / 3.0D);
    double d2 =
        this.getAttributeInstance(GenericAttributes.d).b()
            + entityageable.getAttributeInstance(GenericAttributes.d).b()
            + this.cX();

    entityhorse1.getAttributeInstance(GenericAttributes.d).setValue(d2 / 3.0D);
    return entityhorse1;
  }
Example #2
0
  public boolean mate(EntityAnimal entityanimal) {
    if (entityanimal == this) {
      return false;
    } else if (entityanimal.getClass() != this.getClass()) {
      return false;
    } else {
      EntityHorse entityhorse = (EntityHorse) entityanimal;

      if (this.cT() && entityhorse.cT()) {
        int i = this.getType();
        int j = entityhorse.getType();

        return i == j || i == 0 && j == 1 || i == 1 && j == 0;
      } else {
        return false;
      }
    }
  }