예제 #1
0
파일: Mob.java 프로젝트: spenk/CanaryMod
  /**
   * Spawns this mob with a rider
   *
   * @param rider
   */
  public void spawn(LivingEntity rider) {
    OWorld world = entity.bi; // etc.getMCServer().a(0);

    entity.c(getX() + 0.5d, getY(), getZ() + 0.5d, getRotation(), 0f);
    world.b(entity);

    if (rider != null) {
      OEntityLiving mob2 = rider.getEntity();

      mob2.c(getX(), getY(), getZ(), getRotation(), 0f);
      world.b(mob2);
      mob2.b(entity);
    }
  }
예제 #2
0
  public OEntityThrowable(OWorld oworld, OEntityLiving oentityliving) {
    super(oworld);
    this.g = oentityliving;
    this.a(0.25F, 0.25F);
    this.b(
        oentityliving.u,
        oentityliving.v + (double) oentityliving.e(),
        oentityliving.w,
        oentityliving.A,
        oentityliving.B);
    this.u -= (double) (OMathHelper.b(this.A / 180.0F * 3.1415927F) * 0.16F);
    this.v -= 0.10000000149011612D;
    this.w -= (double) (OMathHelper.a(this.A / 180.0F * 3.1415927F) * 0.16F);
    this.b(this.u, this.v, this.w);
    this.N = 0.0F;
    float f = 0.4F;

    this.x =
        (double)
            (-OMathHelper.a(this.A / 180.0F * 3.1415927F)
                * OMathHelper.b(this.B / 180.0F * 3.1415927F)
                * f);
    this.z =
        (double)
            (OMathHelper.b(this.A / 180.0F * 3.1415927F)
                * OMathHelper.b(this.B / 180.0F * 3.1415927F)
                * f);
    this.y = (double) (-OMathHelper.a((this.B + this.d()) / 180.0F * 3.1415927F) * f);
    this.c(this.x, this.y, this.z, this.c(), 1.0F);
  }
예제 #3
0
  public void a(OEntity paramOEntity, float paramFloat1, float paramFloat2) {
    double d1 = paramOEntity.aL - aL;

    double d2 = paramOEntity.aN - aN;
    double d3;
    if ((paramOEntity instanceof OEntityLiving)) {
      OEntityLiving localOEntityLiving = (OEntityLiving) paramOEntity;
      d3 = aM + s() - (localOEntityLiving.aM + localOEntityLiving.s());
    } else d3 = (paramOEntity.aV.b + paramOEntity.aV.e) / 2.0D - (aM + s());

    double d4 = OMathHelper.a(d1 * d1 + d2 * d2);

    float f1 = (float) (Math.atan2(d2, d1) * 180.0D / 3.141592741012573D) - 90.0F;
    float f2 = (float) (-(Math.atan2(d3, d4) * 180.0D / 3.141592741012573D));
    aS = (-b(aS, f2, paramFloat2));
    aR = b(aR, f1, paramFloat1);
  }
  public void a(OEntity paramOEntity, float paramFloat1, float paramFloat2) {
    double d1 = paramOEntity.aK - aK;

    double d2 = paramOEntity.aM - aM;
    double d3;
    if ((paramOEntity instanceof OEntityLiving)) {
      OEntityLiving localOEntityLiving = (OEntityLiving) paramOEntity;
      d3 = aL + q() - (localOEntityLiving.aL + localOEntityLiving.q());
    } else d3 = (paramOEntity.aU.b + paramOEntity.aU.e) / 2.0D - (aL + q());

    double d4 = OMathHelper.a(d1 * d1 + d2 * d2);

    float f1 = (float) (Math.atan2(d2, d1) * 180.0D / 3.141592741012573D) - 90.0F;
    float f2 = (float) (Math.atan2(d3, d4) * 180.0D / 3.141592741012573D);
    aR = (-b(aR, f2, paramFloat2));
    aQ = b(aQ, f1, paramFloat1);
  }