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;
    }
  }
  // $FF: synthetic class
  static class SyntheticClass_1 {
    // $FF: synthetic field
    static final int[] a;
    // $FF: synthetic field
    static final int[] b = new int[BlockMinecartTrackAbstract.EnumTrackPosition.values().length];

    static {
      try {
        b[BlockMinecartTrackAbstract.EnumTrackPosition.ASCENDING_EAST.ordinal()] = 1;
      } catch (NoSuchFieldError var10) {;
      }

      try {
        b[BlockMinecartTrackAbstract.EnumTrackPosition.ASCENDING_WEST.ordinal()] = 2;
      } catch (NoSuchFieldError var9) {;
      }

      try {
        b[BlockMinecartTrackAbstract.EnumTrackPosition.ASCENDING_NORTH.ordinal()] = 3;
      } catch (NoSuchFieldError var8) {;
      }

      try {
        b[BlockMinecartTrackAbstract.EnumTrackPosition.ASCENDING_SOUTH.ordinal()] = 4;
      } catch (NoSuchFieldError var7) {;
      }

      a = new int[EntityMinecartAbstract.EnumMinecartType.values().length];

      try {
        a[EntityMinecartAbstract.EnumMinecartType.CHEST.ordinal()] = 1;
      } catch (NoSuchFieldError var6) {;
      }

      try {
        a[EntityMinecartAbstract.EnumMinecartType.FURNACE.ordinal()] = 2;
      } catch (NoSuchFieldError var5) {;
      }

      try {
        a[EntityMinecartAbstract.EnumMinecartType.TNT.ordinal()] = 3;
      } catch (NoSuchFieldError var4) {;
      }

      try {
        a[EntityMinecartAbstract.EnumMinecartType.SPAWNER.ordinal()] = 4;
      } catch (NoSuchFieldError var3) {;
      }

      try {
        a[EntityMinecartAbstract.EnumMinecartType.HOPPER.ordinal()] = 5;
      } catch (NoSuchFieldError var2) {;
      }

      try {
        a[EntityMinecartAbstract.EnumMinecartType.COMMAND_BLOCK.ordinal()] = 6;
      } catch (NoSuchFieldError var1) {;
      }
    }
  }
  protected void a(BlockPosition var1, IBlockData var2) {
    this.fallDistance = 0.0F;
    Vec3D var3 = this.k(this.locX, this.locY, this.locZ);
    this.locY = (double) var1.getY();
    boolean var4 = false;
    boolean var5 = false;
    BlockMinecartTrackAbstract var6 = (BlockMinecartTrackAbstract) var2.getBlock();
    if (var6 == Blocks.GOLDEN_RAIL) {
      var4 = ((Boolean) var2.get(BlockPoweredRail.POWERED)).booleanValue();
      var5 = !var4;
    }

    double var7 = 0.0078125D;
    BlockMinecartTrackAbstract.EnumTrackPosition var9 =
        (BlockMinecartTrackAbstract.EnumTrackPosition) var2.get(var6.n());
    switch (EntityMinecartAbstract.SyntheticClass_1.b[var9.ordinal()]) {
      case 1:
        this.motX -= 0.0078125D;
        ++this.locY;
        break;
      case 2:
        this.motX += 0.0078125D;
        ++this.locY;
        break;
      case 3:
        this.motZ += 0.0078125D;
        ++this.locY;
        break;
      case 4:
        this.motZ -= 0.0078125D;
        ++this.locY;
    }

    int[][] var10 = matrix[var9.a()];
    double var11 = (double) (var10[1][0] - var10[0][0]);
    double var13 = (double) (var10[1][2] - var10[0][2]);
    double var15 = Math.sqrt(var11 * var11 + var13 * var13);
    double var17 = this.motX * var11 + this.motZ * var13;
    if (var17 < 0.0D) {
      var11 = -var11;
      var13 = -var13;
    }

    double var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
    if (var19 > 2.0D) {
      var19 = 2.0D;
    }

    this.motX = var19 * var11 / var15;
    this.motZ = var19 * var13 / var15;
    double var21;
    double var23;
    double var25;
    double var27;
    if (this.passenger instanceof EntityLiving) {
      var21 = (double) ((EntityLiving) this.passenger).ba;
      if (var21 > 0.0D) {
        var23 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F));
        var25 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F));
        var27 = this.motX * this.motX + this.motZ * this.motZ;
        if (var27 < 0.01D) {
          this.motX += var23 * 0.1D;
          this.motZ += var25 * 0.1D;
          var5 = false;
        }
      }
    }

    if (var5) {
      var21 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
      if (var21 < 0.03D) {
        this.motX *= 0.0D;
        this.motY *= 0.0D;
        this.motZ *= 0.0D;
      } else {
        this.motX *= 0.5D;
        this.motY *= 0.0D;
        this.motZ *= 0.5D;
      }
    }

    var21 = 0.0D;
    var23 = (double) var1.getX() + 0.5D + (double) var10[0][0] * 0.5D;
    var25 = (double) var1.getZ() + 0.5D + (double) var10[0][2] * 0.5D;
    var27 = (double) var1.getX() + 0.5D + (double) var10[1][0] * 0.5D;
    double var29 = (double) var1.getZ() + 0.5D + (double) var10[1][2] * 0.5D;
    var11 = var27 - var23;
    var13 = var29 - var25;
    double var31;
    double var33;
    if (var11 == 0.0D) {
      this.locX = (double) var1.getX() + 0.5D;
      var21 = this.locZ - (double) var1.getZ();
    } else if (var13 == 0.0D) {
      this.locZ = (double) var1.getZ() + 0.5D;
      var21 = this.locX - (double) var1.getX();
    } else {
      var31 = this.locX - var23;
      var33 = this.locZ - var25;
      var21 = (var31 * var11 + var33 * var13) * 2.0D;
    }

    this.locX = var23 + var11 * var21;
    this.locZ = var25 + var13 * var21;
    this.setPosition(this.locX, this.locY, this.locZ);
    var31 = this.motX;
    var33 = this.motZ;
    if (this.passenger != null) {
      var31 *= 0.75D;
      var33 *= 0.75D;
    }

    double var35 = this.m();
    var31 = MathHelper.a(var31, -var35, var35);
    var33 = MathHelper.a(var33, -var35, var35);
    this.move(var31, 0.0D, var33);
    if (var10[0][1] != 0
        && MathHelper.floor(this.locX) - var1.getX() == var10[0][0]
        && MathHelper.floor(this.locZ) - var1.getZ() == var10[0][2]) {
      this.setPosition(this.locX, this.locY + (double) var10[0][1], this.locZ);
    } else if (var10[1][1] != 0
        && MathHelper.floor(this.locX) - var1.getX() == var10[1][0]
        && MathHelper.floor(this.locZ) - var1.getZ() == var10[1][2]) {
      this.setPosition(this.locX, this.locY + (double) var10[1][1], this.locZ);
    }

    this.o();
    Vec3D var37 = this.k(this.locX, this.locY, this.locZ);
    if (var37 != null && var3 != null) {
      double var38 = (var3.b - var37.b) * 0.05D;
      var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
      if (var19 > 0.0D) {
        this.motX = this.motX / var19 * (var19 + var38);
        this.motZ = this.motZ / var19 * (var19 + var38);
      }

      this.setPosition(this.locX, var37.b, this.locZ);
    }

    int var44 = MathHelper.floor(this.locX);
    int var39 = MathHelper.floor(this.locZ);
    if (var44 != var1.getX() || var39 != var1.getZ()) {
      var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
      this.motX = var19 * (double) (var44 - var1.getX());
      this.motZ = var19 * (double) (var39 - var1.getZ());
    }

    if (var4) {
      double var40 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
      if (var40 > 0.01D) {
        double var42 = 0.06D;
        this.motX += this.motX / var40 * var42;
        this.motZ += this.motZ / var40 * var42;
      } else if (var9 == BlockMinecartTrackAbstract.EnumTrackPosition.EAST_WEST) {
        if (this.world.getType(var1.west()).getBlock().isOccluding()) {
          this.motX = 0.02D;
        } else if (this.world.getType(var1.east()).getBlock().isOccluding()) {
          this.motX = -0.02D;
        }
      } else if (var9 == BlockMinecartTrackAbstract.EnumTrackPosition.NORTH_SOUTH) {
        if (this.world.getType(var1.north()).getBlock().isOccluding()) {
          this.motZ = 0.02D;
        } else if (this.world.getType(var1.south()).getBlock().isOccluding()) {
          this.motZ = -0.02D;
        }
      }
    }
  }