public Vec3D k(double var1, double var3, double var5) {
    int var7 = MathHelper.floor(var1);
    int var8 = MathHelper.floor(var3);
    int var9 = MathHelper.floor(var5);
    if (BlockMinecartTrackAbstract.e(this.world, new BlockPosition(var7, var8 - 1, var9))) {
      --var8;
    }

    IBlockData var10 = this.world.getType(new BlockPosition(var7, var8, var9));
    if (BlockMinecartTrackAbstract.d(var10)) {
      BlockMinecartTrackAbstract.EnumTrackPosition var11 =
          (BlockMinecartTrackAbstract.EnumTrackPosition)
              var10.get(((BlockMinecartTrackAbstract) var10.getBlock()).n());
      int[][] var12 = matrix[var11.a()];
      double var13 = 0.0D;
      double var15 = (double) var7 + 0.5D + (double) var12[0][0] * 0.5D;
      double var17 = (double) var8 + 0.0625D + (double) var12[0][1] * 0.5D;
      double var19 = (double) var9 + 0.5D + (double) var12[0][2] * 0.5D;
      double var21 = (double) var7 + 0.5D + (double) var12[1][0] * 0.5D;
      double var23 = (double) var8 + 0.0625D + (double) var12[1][1] * 0.5D;
      double var25 = (double) var9 + 0.5D + (double) var12[1][2] * 0.5D;
      double var27 = var21 - var15;
      double var29 = (var23 - var17) * 2.0D;
      double var31 = var25 - var19;
      if (var27 == 0.0D) {
        var1 = (double) var7 + 0.5D;
        var13 = var5 - (double) var9;
      } else if (var31 == 0.0D) {
        var5 = (double) var9 + 0.5D;
        var13 = var1 - (double) var7;
      } else {
        double var33 = var1 - var15;
        double var35 = var5 - var19;
        var13 = (var33 * var27 + var35 * var31) * 2.0D;
      }

      var1 = var15 + var27 * var13;
      var3 = var17 + var29 * var13;
      var5 = var19 + var31 * var13;
      if (var29 < 0.0D) {
        ++var3;
      }

      if (var29 > 0.0D) {
        var3 += 0.5D;
      }

      return new Vec3D(var1, var3, var5);
    } else {
      return null;
    }
  }
  public void t_() {
    if (this.getType() > 0) {
      this.j(this.getType() - 1);
    }

    if (this.getDamage() > 0.0F) {
      this.setDamage(this.getDamage() - 1.0F);
    }

    if (this.locY < -64.0D) {
      this.O();
    }

    int var2;
    if (!this.world.isClientSide && this.world instanceof WorldServer) {
      this.world.methodProfiler.a("portal");
      MinecraftServer var1 = ((WorldServer) this.world).getMinecraftServer();
      var2 = this.L();
      if (this.ak) {
        if (var1.getAllowNether()) {
          if (this.vehicle == null && this.al++ >= var2) {
            this.al = var2;
            this.portalCooldown = this.aq();
            byte var3;
            if (this.world.worldProvider.getDimension() == -1) {
              var3 = 0;
            } else {
              var3 = -1;
            }

            this.c(var3);
          }

          this.ak = false;
        }
      } else {
        if (this.al > 0) {
          this.al -= 4;
        }

        if (this.al < 0) {
          this.al = 0;
        }
      }

      if (this.portalCooldown > 0) {
        --this.portalCooldown;
      }

      this.world.methodProfiler.b();
    }

    if (this.world.isClientSide) {
      if (this.d > 0) {
        double var15 = this.locX + (this.e - this.locX) / (double) this.d;
        double var17 = this.locY + (this.f - this.locY) / (double) this.d;
        double var18 = this.locZ + (this.g - this.locZ) / (double) this.d;
        double var7 = MathHelper.g(this.h - (double) this.yaw);
        this.yaw = (float) ((double) this.yaw + var7 / (double) this.d);
        this.pitch =
            (float) ((double) this.pitch + (this.i - (double) this.pitch) / (double) this.d);
        --this.d;
        this.setPosition(var15, var17, var18);
        this.setYawPitch(this.yaw, this.pitch);
      } else {
        this.setPosition(this.locX, this.locY, this.locZ);
        this.setYawPitch(this.yaw, this.pitch);
      }

    } else {
      this.lastX = this.locX;
      this.lastY = this.locY;
      this.lastZ = this.locZ;
      this.motY -= 0.03999999910593033D;
      int var14 = MathHelper.floor(this.locX);
      var2 = MathHelper.floor(this.locY);
      int var16 = MathHelper.floor(this.locZ);
      if (BlockMinecartTrackAbstract.e(this.world, new BlockPosition(var14, var2 - 1, var16))) {
        --var2;
      }

      BlockPosition var4 = new BlockPosition(var14, var2, var16);
      IBlockData var5 = this.world.getType(var4);
      if (BlockMinecartTrackAbstract.d(var5)) {
        this.a(var4, var5);
        if (var5.getBlock() == Blocks.ACTIVATOR_RAIL) {
          this.a(var14, var2, var16, ((Boolean) var5.get(BlockPoweredRail.POWERED)).booleanValue());
        }
      } else {
        this.n();
      }

      this.checkBlockCollisions();
      this.pitch = 0.0F;
      double var6 = this.lastX - this.locX;
      double var8 = this.lastZ - this.locZ;
      if (var6 * var6 + var8 * var8 > 0.001D) {
        this.yaw = (float) (MathHelper.b(var8, var6) * 180.0D / 3.141592653589793D);
        if (this.a) {
          this.yaw += 180.0F;
        }
      }

      double var10 = (double) MathHelper.g(this.yaw - this.lastYaw);
      if (var10 < -170.0D || var10 >= 170.0D) {
        this.yaw += 180.0F;
        this.a = !this.a;
      }

      this.setYawPitch(this.yaw, this.pitch);
      Iterator var12 =
          this.world
              .getEntities(
                  this,
                  this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D))
              .iterator();

      while (var12.hasNext()) {
        Entity var13 = (Entity) var12.next();
        if (var13 != this.passenger && var13.ae() && var13 instanceof EntityMinecartAbstract) {
          var13.collide(this);
        }
      }

      if (this.passenger != null && this.passenger.dead) {
        if (this.passenger.vehicle == this) {
          this.passenger.vehicle = null;
        }

        this.passenger = null;
      }

      this.W();
    }
  }