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);
  }
示例#2
0
  @Override
  protected void a(float paramFloat) {
    int i = (int) Math.ceil(paramFloat - 3.0F);
    if (i > 0) {
      // CanaryMod Damage hook: Falling
      if (!(Boolean)
          manager.callHook(PluginLoader.Hook.DAMAGE, PluginLoader.DamageType.FALL, null, entity, i))
        a((OEntity) null, i);

      int j = aH.a(OMathHelper.b(aL), OMathHelper.b(aK - 0.2D - be), OMathHelper.b(aN));
      if (j > 0) {
        OStepSound localOStepSound = OBlock.m[j].bw;
        aH.a(this, localOStepSound.c(), localOStepSound.a() * 0.5F, localOStepSound.b() * 0.75F);
      }
    }
  }
示例#3
0
  public OVec3D b(float paramFloat) {
    if (paramFloat == 1.0F) {
      float f1 = OMathHelper.b(-aR * 0.01745329F - 3.141593F);
      float f2 = OMathHelper.a(-aR * 0.01745329F - 3.141593F);
      float f3 = -OMathHelper.b(-aS * 0.01745329F);
      float f4 = OMathHelper.a(-aS * 0.01745329F);

      return OVec3D.b(f2 * f3, f4, f1 * f3);
    }
    float f1 = aU + (aS - aU) * paramFloat;
    float f2 = aT + (aR - aT) * paramFloat;

    float f3 = OMathHelper.b(-f2 * 0.01745329F - 3.141593F);
    float f4 = OMathHelper.a(-f2 * 0.01745329F - 3.141593F);
    float f5 = -OMathHelper.b(-f1 * 0.01745329F);
    float f6 = OMathHelper.a(-f1 * 0.01745329F);

    return OVec3D.b(f4 * f5, f6, f3 * f5);
  }
示例#4
0
  public void a(OWorld oworld, int i, int j, int k, OEntityLiving oentityliving) {
    int l = OMathHelper.b((double) (oentityliving.bs * 4.0F / 360.0F) + 0.5D) & 3;
    int i1 = oworld.c(i, j, k) & 4;

    if (l == 0) {
      oworld.c(i, j, k, 2 | i1);
    }

    if (l == 1) {
      oworld.c(i, j, k, 1 | i1);
    }

    if (l == 2) {
      oworld.c(i, j, k, 3 | i1);
    }

    if (l == 3) {
      oworld.c(i, j, k, 0 | i1);
    }
  }
示例#5
0
 public boolean p() {
   int i = OMathHelper.b(aL);
   int j = OMathHelper.b(aV.b);
   int k = OMathHelper.b(aN);
   return aH.a(i, j, k) == OBlock.aF.bl;
 }
示例#6
0
  public void a(float paramFloat1, float paramFloat2) {
    if (Z()) {
      double d1 = aM;
      a(paramFloat1, paramFloat2, 0.02F);
      c(aO, aP, aQ);

      aO *= 0.8D;
      aP *= 0.8D;
      aQ *= 0.8D;
      aP -= 0.02D;

      if ((aX) && (b(aO, aP + 0.6D - aM + d1, aQ))) aP = 0.3D;
    } else if (aa()) {
      double d1 = aM;
      a(paramFloat1, paramFloat2, 0.02F);
      c(aO, aP, aQ);
      aO *= 0.5D;
      aP *= 0.5D;
      aQ *= 0.5D;
      aP -= 0.02D;

      if ((aX) && (b(aO, aP + 0.6000000238418579D - aM + d1, aQ))) aP = 0.300000011920929D;
    } else {
      float f1 = 0.91F;
      if (aW) {
        f1 = 0.546F;
        int i = aH.a(OMathHelper.b(aL), OMathHelper.b(aV.b) - 1, OMathHelper.b(aN));
        if (i > 0) f1 = OBlock.m[i].bz * 0.91F;
      }

      float f2 = 0.1627714F / (f1 * f1 * f1);
      a(paramFloat1, paramFloat2, aW ? 0.1F * f2 : 0.02F);

      f1 = 0.91F;
      if (aW) {
        f1 = 0.546F;
        int j = aH.a(OMathHelper.b(aL), OMathHelper.b(aV.b) - 1, OMathHelper.b(aN));
        if (j > 0) f1 = OBlock.m[j].bz * 0.91F;
      }

      if (p()) {
        bj = 0.0F;
        if (aP < -0.15D) aP = -0.15D;
        if ((ae()) && (aP < 0.0D)) aP = 0.0D;
      }

      c(aO, aP, aQ);

      if ((aX) && (p())) aP = 0.2D;

      aP -= 0.08D;
      aP *= 0.98D;
      aO *= f1;
      aQ *= f1;
    }
    aj = ak;
    double d1 = aL - aI;
    double d2 = aN - aK;
    float f3 = OMathHelper.a(d1 * d1 + d2 * d2) * 4.0F;
    if (f3 > 1.0F) f3 = 1.0F;
    ak += (f3 - ak) * 0.4F;
    al += ak;
  }
 public boolean n() {
   int i = OMathHelper.b(aK);
   int j = OMathHelper.b(aU.b);
   int k = OMathHelper.b(aM);
   return (aG.a(i, j, k) == OBlock.aF.bl) || (aG.a(i, j + 1, k) == OBlock.aF.bl);
 }
  public void a(float paramFloat1, float paramFloat2) {
    if (g_()) {
      double d1 = aL;
      a(paramFloat1, paramFloat2, 0.02F);
      c(aN, aO, aP);

      aN *= 0.800000011920929D;
      aO *= 0.800000011920929D;
      aP *= 0.800000011920929D;
      aO -= 0.02D;

      if ((aW) && (b(aN, aO + 0.6000000238418579D - aL + d1, aP))) aO = 0.300000011920929D;
    } else if (V()) {
      double d1 = aL;
      a(paramFloat1, paramFloat2, 0.02F);
      c(aN, aO, aP);
      aN *= 0.5D;
      aO *= 0.5D;
      aP *= 0.5D;
      aO -= 0.02D;

      if ((aW) && (b(aN, aO + 0.6000000238418579D - aL + d1, aP))) aO = 0.300000011920929D;
    } else {
      float f1 = 0.91F;
      if (aV) {
        f1 = 0.5460001F;
        int i = aG.a(OMathHelper.b(aK), OMathHelper.b(aU.b) - 1, OMathHelper.b(aM));
        if (i > 0) f1 = OBlock.m[i].bx * 0.91F;
      }

      float f2 = 0.1627714F / (f1 * f1 * f1);
      a(paramFloat1, paramFloat2, aV ? 0.1F * f2 : 0.02F);

      f1 = 0.91F;
      if (aV) {
        f1 = 0.5460001F;
        int j = aG.a(OMathHelper.b(aK), OMathHelper.b(aU.b) - 1, OMathHelper.b(aM));
        if (j > 0) f1 = OBlock.m[j].bx * 0.91F;
      }

      if (n()) {
        bh = 0.0F;
        if (aO < -0.15D) aO = -0.15D;
        if ((Z()) && (aO < 0.0D)) aO = 0.0D;
      }

      c(aN, aO, aP);

      if ((aW) && (n())) aO = 0.2D;

      aO -= 0.08D;
      aO *= 0.9800000190734863D;
      aN *= f1;
      aP *= f1;
    }
    ai = aj;
    double d1 = aK - aH;
    double d2 = aM - aJ;
    float f3 = OMathHelper.a(d1 * d1 + d2 * d2) * 4.0F;
    if (f3 > 1.0F) f3 = 1.0F;
    aj += (f3 - aj) * 0.4F;
    ak += aj;
  }