@Override
  protected void bj() {
    motY = 0.46D * ConfigEntries.GUARD_JUMP_MULTIPLIER.<Double>getValue();
    if (hasEffect(MobEffectList.JUMP)) {
      motY += (getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F;
    }
    if (isSprinting()) {
      float f = yaw * 0.01745329F;

      motX -= MathHelper.sin(f) * 0.2F;
      motZ += MathHelper.cos(f) * 0.2F;
    }
    al = true;
  }
Beispiel #2
0
  @Override
  public void h() {
    super.h();
    this.C();

    npc.onTick();
    if (world
            .getType(MathHelper.floor(locX), MathHelper.floor(locY), MathHelper.floor(locZ))
            .getMaterial()
        == Material.FIRE) {
      setOnFire(15);
    }

    // Apply velocity etc.
    this.motY = onGround ? Math.max(0.0, motY) : motY;
    move(motX, motY, motZ);
    this.motX *= 0.800000011920929;
    this.motY *= 0.800000011920929;
    this.motZ *= 0.800000011920929;
    if (gravity && !this.onGround) {
      this.motY -= 0.1; // Most random value, don't judge.
    }
  }