Esempio n. 1
0
  public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) {
    int var7 = MathHelper.func_76128_c(p_70489_1_);
    int var8 = MathHelper.func_76128_c(p_70489_3_);
    int var9 = MathHelper.func_76128_c(p_70489_5_);
    if (BlockRailBase.func_72180_d_(this.field_70170_p, var7, var8 - 1, var9)) {
      --var8;
    }

    int var10 = this.field_70170_p.func_72798_a(var7, var8, var9);
    if (BlockRailBase.func_72184_d(var10)) {
      int var11 = this.field_70170_p.func_72805_g(var7, var8, var9);
      p_70489_3_ = (double) var8;
      if (((BlockRailBase) Block.field_71973_m[var10]).func_72183_n()) {
        var11 &= 7;
      }

      if (var11 >= 2 && var11 <= 5) {
        p_70489_3_ = (double) (var8 + 1);
      }

      int[][] var12 = field_70500_g[var11];
      double var13 = 0.0D;
      double var15 = (double) var7 + 0.5D + (double) var12[0][0] * 0.5D;
      double var17 = (double) var8 + 0.5D + (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.5D + (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) {
        p_70489_1_ = (double) var7 + 0.5D;
        var13 = p_70489_5_ - (double) var9;
      } else if (var31 == 0.0D) {
        p_70489_5_ = (double) var9 + 0.5D;
        var13 = p_70489_1_ - (double) var7;
      } else {
        double var33 = p_70489_1_ - var15;
        double var35 = p_70489_5_ - var19;
        var13 = (var33 * var27 + var35 * var31) * 2.0D;
      }

      p_70489_1_ = var15 + var27 * var13;
      p_70489_3_ = var17 + var29 * var13;
      p_70489_5_ = var19 + var31 * var13;
      if (var29 < 0.0D) {
        ++p_70489_3_;
      }

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

      return this.field_70170_p.func_82732_R().func_72345_a(p_70489_1_, p_70489_3_, p_70489_5_);
    } else {
      return null;
    }
  }
Esempio n. 2
0
  public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) {
    int i = MathHelper.floor_double(p_70489_1_);
    int j = MathHelper.floor_double(p_70489_3_);
    int k = MathHelper.floor_double(p_70489_5_);

    if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) {
      --j;
    }

    IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k));

    if (BlockRailBase.isRailBlock(iblockstate)) {
      BlockRailBase.EnumRailDirection blockrailbase$enumraildirection =
          (BlockRailBase.EnumRailDirection)
              iblockstate.getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty());
      int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()];
      double d0 = 0.0D;
      double d1 = (double) i + 0.5D + (double) aint[0][0] * 0.5D;
      double d2 = (double) j + 0.0625D + (double) aint[0][1] * 0.5D;
      double d3 = (double) k + 0.5D + (double) aint[0][2] * 0.5D;
      double d4 = (double) i + 0.5D + (double) aint[1][0] * 0.5D;
      double d5 = (double) j + 0.0625D + (double) aint[1][1] * 0.5D;
      double d6 = (double) k + 0.5D + (double) aint[1][2] * 0.5D;
      double d7 = d4 - d1;
      double d8 = (d5 - d2) * 2.0D;
      double d9 = d6 - d3;

      if (d7 == 0.0D) {
        p_70489_1_ = (double) i + 0.5D;
        d0 = p_70489_5_ - (double) k;
      } else if (d9 == 0.0D) {
        p_70489_5_ = (double) k + 0.5D;
        d0 = p_70489_1_ - (double) i;
      } else {
        double d10 = p_70489_1_ - d1;
        double d11 = p_70489_5_ - d3;
        d0 = (d10 * d7 + d11 * d9) * 2.0D;
      }

      p_70489_1_ = d1 + d7 * d0;
      p_70489_3_ = d2 + d8 * d0;
      p_70489_5_ = d3 + d9 * d0;

      if (d8 < 0.0D) {
        ++p_70489_3_;
      }

      if (d8 > 0.0D) {
        p_70489_3_ += 0.5D;
      }

      return new Vec3(p_70489_1_, p_70489_3_, p_70489_5_);
    } else {
      return null;
    }
  }
Esempio n. 3
0
  public Vec3 func_70495_a(
      double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) {
    int i = MathHelper.floor_double(p_70495_1_);
    int j = MathHelper.floor_double(p_70495_3_);
    int k = MathHelper.floor_double(p_70495_5_);

    if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) {
      --j;
    }

    IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k));

    if (BlockRailBase.isRailBlock(iblockstate)) {
      BlockRailBase.EnumRailDirection blockrailbase$enumraildirection =
          (BlockRailBase.EnumRailDirection)
              iblockstate.getValue(((BlockRailBase) iblockstate.getBlock()).getShapeProperty());
      p_70495_3_ = (double) j;

      if (blockrailbase$enumraildirection.isAscending()) {
        p_70495_3_ = (double) (j + 1);
      }

      int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()];
      double d0 = (double) (aint[1][0] - aint[0][0]);
      double d1 = (double) (aint[1][2] - aint[0][2]);
      double d2 = Math.sqrt(d0 * d0 + d1 * d1);
      d0 = d0 / d2;
      d1 = d1 / d2;
      p_70495_1_ = p_70495_1_ + d0 * p_70495_7_;
      p_70495_5_ = p_70495_5_ + d1 * p_70495_7_;

      if (aint[0][1] != 0
          && MathHelper.floor_double(p_70495_1_) - i == aint[0][0]
          && MathHelper.floor_double(p_70495_5_) - k == aint[0][2]) {
        p_70495_3_ += (double) aint[0][1];
      } else if (aint[1][1] != 0
          && MathHelper.floor_double(p_70495_1_) - i == aint[1][0]
          && MathHelper.floor_double(p_70495_5_) - k == aint[1][2]) {
        p_70495_3_ += (double) aint[1][1];
      }

      return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_);
    } else {
      return null;
    }
  }
Esempio n. 4
0
  @SideOnly(Side.CLIENT)
  public Vec3 func_70495_a(
      double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) {
    int var9 = MathHelper.func_76128_c(p_70495_1_);
    int var10 = MathHelper.func_76128_c(p_70495_3_);
    int var11 = MathHelper.func_76128_c(p_70495_5_);
    if (BlockRailBase.func_72180_d_(this.field_70170_p, var9, var10 - 1, var11)) {
      --var10;
    }

    int var12 = this.field_70170_p.func_72798_a(var9, var10, var11);
    if (!BlockRailBase.func_72184_d(var12)) {
      return null;
    } else {
      int var13 = this.field_70170_p.func_72805_g(var9, var10, var11);
      if (((BlockRailBase) Block.field_71973_m[var12]).func_72183_n()) {
        var13 &= 7;
      }

      p_70495_3_ = (double) var10;
      if (var13 >= 2 && var13 <= 5) {
        p_70495_3_ = (double) (var10 + 1);
      }

      int[][] var14 = field_70500_g[var13];
      double var15 = (double) (var14[1][0] - var14[0][0]);
      double var17 = (double) (var14[1][2] - var14[0][2]);
      double var19 = Math.sqrt(var15 * var15 + var17 * var17);
      var15 /= var19;
      var17 /= var19;
      p_70495_1_ += var15 * p_70495_7_;
      p_70495_5_ += var17 * p_70495_7_;
      if (var14[0][1] != 0
          && MathHelper.func_76128_c(p_70495_1_) - var9 == var14[0][0]
          && MathHelper.func_76128_c(p_70495_5_) - var11 == var14[0][2]) {
        p_70495_3_ += (double) var14[0][1];
      } else if (var14[1][1] != 0
          && MathHelper.func_76128_c(p_70495_1_) - var9 == var14[1][0]
          && MathHelper.func_76128_c(p_70495_5_) - var11 == var14[1][2]) {
        p_70495_3_ += (double) var14[1][1];
      }

      return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_);
    }
  }
 @Override
 public boolean onItemUse(
     ItemStack is,
     EntityPlayer ep,
     World world,
     int x,
     int y,
     int z,
     int s,
     float a,
     float b,
     float c) {
   Block id = world.getBlock(x, y, z);
   if (BlockRailBase.func_150051_a(id)) {
     if (!world.isRemote) {
       EntityGasMinecart cart = new EntityGasMinecart(world, x + 0.5, y + 0.5, z + 0.5);
       world.spawnEntityInWorld(cart);
     }
     if (!ep.capabilities.isCreativeMode) --is.stackSize;
     return true;
   }
   return false;
 }
Esempio n. 6
0
  @SuppressWarnings("incomplete-switch")
  protected void func_180460_a(BlockPos p_180460_1_, IBlockState p_180460_2_) {
    this.fallDistance = 0.0F;
    Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ);
    this.posY = (double) p_180460_1_.getY();
    boolean flag = false;
    boolean flag1 = false;
    BlockRailBase blockrailbase = (BlockRailBase) p_180460_2_.getBlock();

    if (blockrailbase == Blocks.golden_rail) {
      flag = ((Boolean) p_180460_2_.getValue(BlockRailPowered.POWERED)).booleanValue();
      flag1 = !flag;
    }

    double d0 = 0.0078125D;
    BlockRailBase.EnumRailDirection blockrailbase$enumraildirection =
        (BlockRailBase.EnumRailDirection) p_180460_2_.getValue(blockrailbase.getShapeProperty());

    switch (blockrailbase$enumraildirection) {
      case ASCENDING_EAST:
        this.motionX -= 0.0078125D;
        ++this.posY;
        break;

      case ASCENDING_WEST:
        this.motionX += 0.0078125D;
        ++this.posY;
        break;

      case ASCENDING_NORTH:
        this.motionZ += 0.0078125D;
        ++this.posY;
        break;

      case ASCENDING_SOUTH:
        this.motionZ -= 0.0078125D;
        ++this.posY;
    }

    int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()];
    double d1 = (double) (aint[1][0] - aint[0][0]);
    double d2 = (double) (aint[1][2] - aint[0][2]);
    double d3 = Math.sqrt(d1 * d1 + d2 * d2);
    double d4 = this.motionX * d1 + this.motionZ * d2;

    if (d4 < 0.0D) {
      d1 = -d1;
      d2 = -d2;
    }

    double d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);

    if (d5 > 2.0D) {
      d5 = 2.0D;
    }

    this.motionX = d5 * d1 / d3;
    this.motionZ = d5 * d2 / d3;

    if (this.riddenByEntity instanceof EntityLivingBase) {
      double d6 = (double) ((EntityLivingBase) this.riddenByEntity).moveForward;

      if (d6 > 0.0D) {
        double d7 =
            -Math.sin((double) (this.riddenByEntity.rotationYaw * (float) Math.PI / 180.0F));
        double d8 = Math.cos((double) (this.riddenByEntity.rotationYaw * (float) Math.PI / 180.0F));
        double d9 = this.motionX * this.motionX + this.motionZ * this.motionZ;

        if (d9 < 0.01D) {
          this.motionX += d7 * 0.1D;
          this.motionZ += d8 * 0.1D;
          flag1 = false;
        }
      }
    }

    if (flag1) {
      double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);

      if (d17 < 0.03D) {
        this.motionX *= 0.0D;
        this.motionY *= 0.0D;
        this.motionZ *= 0.0D;
      } else {
        this.motionX *= 0.5D;
        this.motionY *= 0.0D;
        this.motionZ *= 0.5D;
      }
    }

    double d18 = 0.0D;
    double d19 = (double) p_180460_1_.getX() + 0.5D + (double) aint[0][0] * 0.5D;
    double d20 = (double) p_180460_1_.getZ() + 0.5D + (double) aint[0][2] * 0.5D;
    double d21 = (double) p_180460_1_.getX() + 0.5D + (double) aint[1][0] * 0.5D;
    double d10 = (double) p_180460_1_.getZ() + 0.5D + (double) aint[1][2] * 0.5D;
    d1 = d21 - d19;
    d2 = d10 - d20;

    if (d1 == 0.0D) {
      this.posX = (double) p_180460_1_.getX() + 0.5D;
      d18 = this.posZ - (double) p_180460_1_.getZ();
    } else if (d2 == 0.0D) {
      this.posZ = (double) p_180460_1_.getZ() + 0.5D;
      d18 = this.posX - (double) p_180460_1_.getX();
    } else {
      double d11 = this.posX - d19;
      double d12 = this.posZ - d20;
      d18 = (d11 * d1 + d12 * d2) * 2.0D;
    }

    this.posX = d19 + d1 * d18;
    this.posZ = d20 + d2 * d18;
    this.setPosition(this.posX, this.posY, this.posZ);
    double d22 = this.motionX;
    double d23 = this.motionZ;

    if (this.riddenByEntity != null) {
      d22 *= 0.75D;
      d23 *= 0.75D;
    }

    double d13 = this.getMaximumSpeed();
    d22 = MathHelper.clamp_double(d22, -d13, d13);
    d23 = MathHelper.clamp_double(d23, -d13, d13);
    this.moveEntity(d22, 0.0D, d23);

    if (aint[0][1] != 0
        && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0]
        && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2]) {
      this.setPosition(this.posX, this.posY + (double) aint[0][1], this.posZ);
    } else if (aint[1][1] != 0
        && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[1][0]
        && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[1][2]) {
      this.setPosition(this.posX, this.posY + (double) aint[1][1], this.posZ);
    }

    this.applyDrag();
    Vec3 vec31 = this.func_70489_a(this.posX, this.posY, this.posZ);

    if (vec31 != null && vec3 != null) {
      double d14 = (vec3.yCoord - vec31.yCoord) * 0.05D;
      d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);

      if (d5 > 0.0D) {
        this.motionX = this.motionX / d5 * (d5 + d14);
        this.motionZ = this.motionZ / d5 * (d5 + d14);
      }

      this.setPosition(this.posX, vec31.yCoord, this.posZ);
    }

    int j = MathHelper.floor_double(this.posX);
    int i = MathHelper.floor_double(this.posZ);

    if (j != p_180460_1_.getX() || i != p_180460_1_.getZ()) {
      d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
      this.motionX = d5 * (double) (j - p_180460_1_.getX());
      this.motionZ = d5 * (double) (i - p_180460_1_.getZ());
    }

    if (flag) {
      double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);

      if (d15 > 0.01D) {
        double d16 = 0.06D;
        this.motionX += this.motionX / d15 * d16;
        this.motionZ += this.motionZ / d15 * d16;
      } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) {
        if (this.worldObj.getBlockState(p_180460_1_.west()).getBlock().isNormalCube()) {
          this.motionX = 0.02D;
        } else if (this.worldObj.getBlockState(p_180460_1_.east()).getBlock().isNormalCube()) {
          this.motionX = -0.02D;
        }
      } else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) {
        if (this.worldObj.getBlockState(p_180460_1_.north()).getBlock().isNormalCube()) {
          this.motionZ = 0.02D;
        } else if (this.worldObj.getBlockState(p_180460_1_.south()).getBlock().isNormalCube()) {
          this.motionZ = -0.02D;
        }
      }
    }
  }
Esempio n. 7
0
  /** Called to update the entity's position/logic. */
  public void onUpdate() {
    if (this.getRollingAmplitude() > 0) {
      this.setRollingAmplitude(this.getRollingAmplitude() - 1);
    }

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

    if (this.posY < -64.0D) {
      this.kill();
    }

    if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) {
      this.worldObj.theProfiler.startSection("portal");
      MinecraftServer minecraftserver = ((WorldServer) this.worldObj).getMinecraftServer();
      int i = this.getMaxInPortalTime();

      if (this.inPortal) {
        if (minecraftserver.getAllowNether()) {
          if (this.ridingEntity == null && this.portalCounter++ >= i) {
            this.portalCounter = i;
            this.timeUntilPortal = this.getPortalCooldown();
            int j;

            if (this.worldObj.provider.getDimensionId() == -1) {
              j = 0;
            } else {
              j = -1;
            }

            this.travelToDimension(j);
          }

          this.inPortal = false;
        }
      } else {
        if (this.portalCounter > 0) {
          this.portalCounter -= 4;
        }

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

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

      this.worldObj.theProfiler.endSection();
    }

    if (this.worldObj.isRemote) {
      if (this.turnProgress > 0) {
        double d4 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress;
        double d5 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress;
        double d6 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress;
        double d1 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw);
        this.rotationYaw = (float) ((double) this.rotationYaw + d1 / (double) this.turnProgress);
        this.rotationPitch =
            (float)
                ((double) this.rotationPitch
                    + (this.minecartPitch - (double) this.rotationPitch)
                        / (double) this.turnProgress);
        --this.turnProgress;
        this.setPosition(d4, d5, d6);
        this.setRotation(this.rotationYaw, this.rotationPitch);
      } else {
        this.setPosition(this.posX, this.posY, this.posZ);
        this.setRotation(this.rotationYaw, this.rotationPitch);
      }
    } else {
      this.prevPosX = this.posX;
      this.prevPosY = this.posY;
      this.prevPosZ = this.posZ;
      this.motionY -= 0.03999999910593033D;
      int k = MathHelper.floor_double(this.posX);
      int l = MathHelper.floor_double(this.posY);
      int i1 = MathHelper.floor_double(this.posZ);

      if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1))) {
        --l;
      }

      BlockPos blockpos = new BlockPos(k, l, i1);
      IBlockState iblockstate = this.worldObj.getBlockState(blockpos);

      if (BlockRailBase.isRailBlock(iblockstate)) {
        this.func_180460_a(blockpos, iblockstate);

        if (iblockstate.getBlock() == Blocks.activator_rail) {
          this.onActivatorRailPass(
              k, l, i1, ((Boolean) iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue());
        }
      } else {
        this.moveDerailedMinecart();
      }

      this.doBlockCollisions();
      this.rotationPitch = 0.0F;
      double d0 = this.prevPosX - this.posX;
      double d2 = this.prevPosZ - this.posZ;

      if (d0 * d0 + d2 * d2 > 0.001D) {
        this.rotationYaw = (float) (MathHelper.func_181159_b(d2, d0) * 180.0D / Math.PI);

        if (this.isInReverse) {
          this.rotationYaw += 180.0F;
        }
      }

      double d3 = (double) MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw);

      if (d3 < -170.0D || d3 >= 170.0D) {
        this.rotationYaw += 180.0F;
        this.isInReverse = !this.isInReverse;
      }

      this.setRotation(this.rotationYaw, this.rotationPitch);

      for (Entity entity :
          this.worldObj.getEntitiesWithinAABBExcludingEntity(
              this,
              this.getEntityBoundingBox()
                  .expand(0.20000000298023224D, 0.0D, 0.20000000298023224D))) {
        if (entity != this.riddenByEntity
            && entity.canBePushed()
            && entity instanceof EntityMinecart) {
          entity.applyEntityCollision(this);
        }
      }

      if (this.riddenByEntity != null && this.riddenByEntity.isDead) {
        if (this.riddenByEntity.ridingEntity == this) {
          this.riddenByEntity.ridingEntity = null;
        }

        this.riddenByEntity = null;
      }

      this.handleWaterMovement();
    }
  }
Esempio n. 8
0
  public void func_70071_h_() {
    if (this.field_82344_g != null) {
      this.field_82344_g.func_73660_a();
    }

    if (this.func_70496_j() > 0) {
      this.func_70497_h(this.func_70496_j() - 1);
    }

    if (this.func_70491_i() > 0.0F) {
      this.func_70492_c(this.func_70491_i() - 1.0F);
    }

    if (this.field_70163_u < -64.0D) {
      this.func_70076_C();
    }

    int var2;
    if (!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
      this.field_70170_p.field_72984_F.func_76320_a("portal");
      MinecraftServer var1 = ((WorldServer) this.field_70170_p).func_73046_m();
      var2 = this.func_82145_z();
      if (this.field_71087_bX) {
        if (var1.func_71255_r()) {
          if (this.field_70154_o == null && this.field_82153_h++ >= var2) {
            this.field_82153_h = var2;
            this.field_71088_bW = this.func_82147_ab();
            byte var3;
            if (this.field_70170_p.field_73011_w.field_76574_g == -1) {
              var3 = 0;
            } else {
              var3 = -1;
            }

            this.func_71027_c(var3);
          }

          this.field_71087_bX = false;
        }
      } else {
        if (this.field_82153_h > 0) {
          this.field_82153_h -= 4;
        }

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

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

      this.field_70170_p.field_72984_F.func_76319_b();
    }

    if (this.field_70170_p.field_72995_K) {
      if (this.field_70510_h > 0) {
        double var19 =
            this.field_70165_t
                + (this.field_70511_i - this.field_70165_t) / (double) this.field_70510_h;
        double var21 =
            this.field_70163_u
                + (this.field_70509_j - this.field_70163_u) / (double) this.field_70510_h;
        double var5 =
            this.field_70161_v
                + (this.field_70514_an - this.field_70161_v) / (double) this.field_70510_h;
        double var7 = MathHelper.func_76138_g(this.field_70512_ao - (double) this.field_70177_z);
        this.field_70177_z =
            (float) ((double) this.field_70177_z + var7 / (double) this.field_70510_h);
        this.field_70125_A =
            (float)
                ((double) this.field_70125_A
                    + (this.field_70513_ap - (double) this.field_70125_A)
                        / (double) this.field_70510_h);
        --this.field_70510_h;
        this.func_70107_b(var19, var21, var5);
        this.func_70101_b(this.field_70177_z, this.field_70125_A);
      } else {
        this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
        this.func_70101_b(this.field_70177_z, this.field_70125_A);
      }

    } else {
      this.field_70169_q = this.field_70165_t;
      this.field_70167_r = this.field_70163_u;
      this.field_70166_s = this.field_70161_v;
      this.field_70181_x -= 0.03999999910593033D;
      int var18 = MathHelper.func_76128_c(this.field_70165_t);
      var2 = MathHelper.func_76128_c(this.field_70163_u);
      int var20 = MathHelper.func_76128_c(this.field_70161_v);
      if (BlockRailBase.func_72180_d_(this.field_70170_p, var18, var2 - 1, var20)) {
        --var2;
      }

      double var4 = 0.4D;
      double var6 = 0.0078125D;
      int var8 = this.field_70170_p.func_72798_a(var18, var2, var20);
      if (BlockRailBase.func_72184_d(var8)) {
        int var9 = this.field_70170_p.func_72805_g(var18, var2, var20);
        this.func_94091_a(var18, var2, var20, var4, var6, var8, var9);
        if (var8 == Block.field_94337_cv.field_71990_ca) {
          this.func_96095_a(var18, var2, var20, (var9 & 8) != 0);
        }
      } else {
        this.func_94088_b(var4);
      }

      this.func_70017_D();
      this.field_70125_A = 0.0F;
      double var22 = this.field_70169_q - this.field_70165_t;
      double var11 = this.field_70166_s - this.field_70161_v;
      if (var22 * var22 + var11 * var11 > 0.001D) {
        this.field_70177_z = (float) (Math.atan2(var11, var22) * 180.0D / 3.141592653589793D);
        if (this.field_70499_f) {
          this.field_70177_z += 180.0F;
        }
      }

      double var13 = (double) MathHelper.func_76142_g(this.field_70177_z - this.field_70126_B);
      if (var13 < -170.0D || var13 >= 170.0D) {
        this.field_70177_z += 180.0F;
        this.field_70499_f = !this.field_70499_f;
      }

      this.func_70101_b(this.field_70177_z, this.field_70125_A);
      List var15 =
          this.field_70170_p.func_72839_b(
              this,
              this.field_70121_D.func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
      if (var15 != null && !var15.isEmpty()) {
        for (int var16 = 0; var16 < var15.size(); ++var16) {
          Entity var17 = (Entity) var15.get(var16);
          if (var17 != this.field_70153_n
              && var17.func_70104_M()
              && var17 instanceof EntityMinecart) {
            var17.func_70108_f(this);
          }
        }
      }

      if (this.field_70153_n != null && this.field_70153_n.field_70128_L) {
        if (this.field_70153_n.field_70154_o == this) {
          this.field_70153_n.field_70154_o = null;
        }

        this.field_70153_n = null;
      }
    }
  }