Program: 171510
Project: 171510
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (!world.isRemote) {
    if (ConfigDebug.serverTickCompensation) {
      this.tickSkew=20 / CommonProxy.getServerTPS(getEntityWorld(),1);
    }
 else {
      this.tickSkew=1;
    }
  }
  if (world.isRemote) {
    if (ConfigSound.soundEnabled) {
      if (this.wheel_sound == null) {
        wheel_sound=ImmersiveRailroading.proxy.newSound(this.getDefinition().wheel_sound,true,40,gauge);
        this.sndRand=(float)Math.random() / 10;
      }
      if (Math.abs(this.getCurrentSpeed().metric()) > 5) {
        if (!wheel_sound.isPlaying()) {
          wheel_sound.play(this.getPositionVector());
        }
        float adjust=(float)Math.abs(this.getCurrentSpeed().metric()) / 300;
        wheel_sound.setPitch(adjust + 0.7f + this.sndRand);
        wheel_sound.setVolume(adjust);
        wheel_sound.setPosition(getPositionVector());
        wheel_sound.setVelocity(getVelocity());
        wheel_sound.update();
      }
 else {
        if (wheel_sound.isPlaying()) {
          wheel_sound.stop();
          ;
        }
      }
    }
  }
  this.tickPosID+=this.getTickSkew();
  TickPos currentPos=getCurrentTickPosAndPrune();
  if (currentPos == null) {
    return;
  }
  this.prevPosX=this.posX;
  this.prevPosY=this.posY;
  this.prevPosZ=this.posZ;
  this.lastTickPosX=this.posX;
  this.lastTickPosY=this.posY;
  this.lastTickPosZ=this.posZ;
  this.prevRotationYaw=this.rotationYaw;
  this.prevRotationPitch=this.rotationPitch;
  this.posX=skewScalar(this.posX,currentPos.position.x);
  this.posY=skewScalar(this.posY,currentPos.position.y);
  this.posZ=skewScalar(this.posZ,currentPos.position.z);
  if (world.isRemote) {
    this.prevRotationYaw=fixAngleInterp(this.prevRotationYaw,currentPos.rotationYaw);
    this.rotationYaw=fixAngleInterp(this.rotationYaw,currentPos.rotationYaw);
    this.frontYaw=fixAngleInterp(this.frontYaw == null ? this.rotationYaw : this.frontYaw,currentPos.frontYaw);
    this.rearYaw=fixAngleInterp(this.rearYaw == null ? this.rotationYaw : this.rearYaw,currentPos.rearYaw);
  }
  this.rotationYaw=skewScalar(this.rotationYaw,currentPos.rotationYaw);
  this.rotationPitch=skewScalar(this.rotationPitch,currentPos.rotationPitch);
  this.frontYaw=skewScalar(this.frontYaw == null ? this.rotationYaw : this.frontYaw,currentPos.frontYaw);
  this.rearYaw=skewScalar(this.rearYaw == null ? this.rotationYaw : this.rearYaw,currentPos.rearYaw);
  this.currentSpeed=currentPos.speed;
  distanceTraveled=skewScalar(distanceTraveled,distanceTraveled + (float)this.currentSpeed.minecraft());
  this.motionX=this.posX - this.prevPosX;
  this.motionY=this.posY - this.prevPosY;
  this.motionZ=this.posZ - this.prevPosZ;
  if (Math.abs(this.motionX) + Math.abs(this.motionY) + Math.abs(this.motionZ) > 0.001) {
    this.clearPositionCache();
  }
  if (this.getCurrentSpeed().metric() > 1) {
    List<Entity> entitiesWithin=world.getEntitiesWithinAABB(EntityLiving.class,this.getCollisionBoundingBox().offset(0,-0.5,0));
    for (    Entity entity : entitiesWithin) {
      if (entity instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (entity.getRidingEntity() instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (!(entity instanceof EntityLivingBase)) {
        continue;
      }
      if (entity instanceof EntityPlayer) {
        if (entity.ticksExisted < 20 * 5) {
          continue;
        }
      }
      if (!this.getCollisionBoundingBox().intersects(entity.getEntityBoundingBox())) {
        continue;
      }
      entity.motionX=this.motionX * 2;
      entity.motionY=0;
      entity.motionZ=this.motionZ * 2;
      entity.onUpdate();
      double speedDamage=this.getCurrentSpeed().metric() / ConfigDamage.entitySpeedDamage;
      if (speedDamage > 1) {
        entity.attackEntityFrom((new DamageSource("String_Node_Str")).setDamageBypassesArmor(),(float)speedDamage);
      }
    }
    AxisAlignedBB bb=this.getCollisionBoundingBox();
    bb=bb.offset(0,gauge.scale() * 2,0);
    List<Entity> entitiesAbove=world.getEntitiesWithinAABB(EntityLiving.class,bb);
    for (    Entity entity : entitiesAbove) {
      if (entity instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (entity.getRidingEntity() instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (!(entity instanceof EntityLivingBase)) {
        continue;
      }
      if (!bb.intersects(entity.getEntityBoundingBox())) {
        continue;
      }
      entity.motionX=this.motionX;
      entity.motionY=entity.motionY + this.motionY;
      entity.motionZ=this.motionZ;
    }
  }
  if (!world.isRemote && this.ticksExisted % 5 == 0 && ConfigDamage.TrainsBreakBlocks && Math.abs(this.getCurrentSpeed().metric()) > 0.5) {
    AxisAlignedBB bb=this.getCollisionBoundingBox().grow(-0.25 * gauge.scale(),0,-0.25 * gauge.scale());
    for (    Vec3d pos : this.getDefinition().getBlocksInBounds(gauge)) {
      if (pos.lengthVector() < this.getDefinition().getLength(gauge) / 2) {
        continue;
      }
      pos=VecUtil.rotateYaw(pos,this.rotationYaw);
      pos=pos.add(this.getPositionVector());
      BlockPos bp=new BlockPos(pos);
      if (!world.isBlockLoaded(bp)) {
        continue;
      }
      IBlockState state=world.getBlockState(bp);
      if (state.getBlock() != Blocks.AIR) {
        if (!BlockUtil.isIRRail(world,bp)) {
          AxisAlignedBB bbb=state.getCollisionBoundingBox(world,bp);
          if (bbb == null) {
            continue;
          }
          bbb=bbb.offset(bp);
          if (bb.intersects(bbb)) {
            if (!BlockUtil.isIRRail(world,bp.up())) {
              world.destroyBlock(bp,Config.ConfigDamage.dropSnowBalls || !(state.getBlock() == Blocks.SNOW || state.getBlock() == Blocks.SNOW_LAYER));
            }
          }
        }
 else {
          TileRailBase te=TileRailBase.get(world,bp);
          if (te != null) {
            te.cleanSnow();
            continue;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (!world.isRemote) {
    if (ConfigDebug.serverTickCompensation) {
      this.tickSkew=20 / CommonProxy.getServerTPS(getEntityWorld(),1);
    }
 else {
      this.tickSkew=1;
    }
    if (this.ticksExisted % 10 == 0) {
      lastRetarderPos=null;
    }
  }
  if (world.isRemote) {
    if (ConfigSound.soundEnabled) {
      if (this.wheel_sound == null) {
        wheel_sound=ImmersiveRailroading.proxy.newSound(this.getDefinition().wheel_sound,true,40,gauge);
        this.sndRand=(float)Math.random() / 10;
      }
      if (Math.abs(this.getCurrentSpeed().metric()) > 5) {
        if (!wheel_sound.isPlaying()) {
          wheel_sound.play(this.getPositionVector());
        }
        float adjust=(float)Math.abs(this.getCurrentSpeed().metric()) / 300;
        wheel_sound.setPitch(adjust + 0.7f + this.sndRand);
        wheel_sound.setVolume(adjust);
        wheel_sound.setPosition(getPositionVector());
        wheel_sound.setVelocity(getVelocity());
        wheel_sound.update();
      }
 else {
        if (wheel_sound.isPlaying()) {
          wheel_sound.stop();
          ;
        }
      }
    }
  }
  this.tickPosID+=this.getTickSkew();
  TickPos currentPos=getCurrentTickPosAndPrune();
  if (currentPos == null) {
    return;
  }
  this.prevPosX=this.posX;
  this.prevPosY=this.posY;
  this.prevPosZ=this.posZ;
  this.lastTickPosX=this.posX;
  this.lastTickPosY=this.posY;
  this.lastTickPosZ=this.posZ;
  this.prevRotationYaw=this.rotationYaw;
  this.prevRotationPitch=this.rotationPitch;
  this.posX=skewScalar(this.posX,currentPos.position.x);
  this.posY=skewScalar(this.posY,currentPos.position.y);
  this.posZ=skewScalar(this.posZ,currentPos.position.z);
  if (world.isRemote) {
    this.prevRotationYaw=fixAngleInterp(this.prevRotationYaw,currentPos.rotationYaw);
    this.rotationYaw=fixAngleInterp(this.rotationYaw,currentPos.rotationYaw);
    this.frontYaw=fixAngleInterp(this.frontYaw == null ? this.rotationYaw : this.frontYaw,currentPos.frontYaw);
    this.rearYaw=fixAngleInterp(this.rearYaw == null ? this.rotationYaw : this.rearYaw,currentPos.rearYaw);
  }
  this.rotationYaw=skewScalar(this.rotationYaw,currentPos.rotationYaw);
  this.rotationPitch=skewScalar(this.rotationPitch,currentPos.rotationPitch);
  this.frontYaw=skewScalar(this.frontYaw == null ? this.rotationYaw : this.frontYaw,currentPos.frontYaw);
  this.rearYaw=skewScalar(this.rearYaw == null ? this.rotationYaw : this.rearYaw,currentPos.rearYaw);
  this.currentSpeed=currentPos.speed;
  distanceTraveled=skewScalar(distanceTraveled,distanceTraveled + (float)this.currentSpeed.minecraft());
  this.motionX=this.posX - this.prevPosX;
  this.motionY=this.posY - this.prevPosY;
  this.motionZ=this.posZ - this.prevPosZ;
  if (Math.abs(this.motionX) + Math.abs(this.motionY) + Math.abs(this.motionZ) > 0.001) {
    this.clearPositionCache();
  }
  if (this.getCurrentSpeed().metric() > 1) {
    List<Entity> entitiesWithin=world.getEntitiesWithinAABB(EntityLiving.class,this.getCollisionBoundingBox().offset(0,-0.5,0));
    for (    Entity entity : entitiesWithin) {
      if (entity instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (entity.getRidingEntity() instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (!(entity instanceof EntityLivingBase)) {
        continue;
      }
      if (entity instanceof EntityPlayer) {
        if (entity.ticksExisted < 20 * 5) {
          continue;
        }
      }
      if (!this.getCollisionBoundingBox().intersects(entity.getEntityBoundingBox())) {
        continue;
      }
      entity.motionX=this.motionX * 2;
      entity.motionY=0;
      entity.motionZ=this.motionZ * 2;
      entity.onUpdate();
      double speedDamage=this.getCurrentSpeed().metric() / ConfigDamage.entitySpeedDamage;
      if (speedDamage > 1) {
        entity.attackEntityFrom((new DamageSource("String_Node_Str")).setDamageBypassesArmor(),(float)speedDamage);
      }
    }
    AxisAlignedBB bb=this.getCollisionBoundingBox();
    bb=bb.offset(0,gauge.scale() * 2,0);
    List<Entity> entitiesAbove=world.getEntitiesWithinAABB(EntityLiving.class,bb);
    for (    Entity entity : entitiesAbove) {
      if (entity instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (entity.getRidingEntity() instanceof EntityMoveableRollingStock) {
        continue;
      }
      if (!(entity instanceof EntityLivingBase)) {
        continue;
      }
      if (!bb.intersects(entity.getEntityBoundingBox())) {
        continue;
      }
      entity.motionX=this.motionX;
      entity.motionY=entity.motionY + this.motionY;
      entity.motionZ=this.motionZ;
    }
  }
  if (!world.isRemote && this.ticksExisted % 5 == 0 && ConfigDamage.TrainsBreakBlocks && Math.abs(this.getCurrentSpeed().metric()) > 0.5) {
    AxisAlignedBB bb=this.getCollisionBoundingBox().grow(-0.25 * gauge.scale(),0,-0.25 * gauge.scale());
    for (    Vec3d pos : this.getDefinition().getBlocksInBounds(gauge)) {
      if (pos.lengthVector() < this.getDefinition().getLength(gauge) / 2) {
        continue;
      }
      pos=VecUtil.rotateYaw(pos,this.rotationYaw);
      pos=pos.add(this.getPositionVector());
      BlockPos bp=new BlockPos(pos);
      if (!world.isBlockLoaded(bp)) {
        continue;
      }
      IBlockState state=world.getBlockState(bp);
      if (state.getBlock() != Blocks.AIR) {
        if (!BlockUtil.isIRRail(world,bp)) {
          AxisAlignedBB bbb=state.getCollisionBoundingBox(world,bp);
          if (bbb == null) {
            continue;
          }
          bbb=bbb.offset(bp);
          if (bb.intersects(bbb)) {
            if (!BlockUtil.isIRRail(world,bp.up())) {
              world.destroyBlock(bp,Config.ConfigDamage.dropSnowBalls || !(state.getBlock() == Blocks.SNOW || state.getBlock() == Blocks.SNOW_LAYER));
            }
          }
        }
 else {
          TileRailBase te=TileRailBase.get(world,bp);
          if (te != null) {
            te.cleanSnow();
            continue;
          }
        }
      }
    }
  }
}