Program: 134164
Project: 134164
Buggy source:
private void affect(Entity entity){
  boolean isUser=entity.getEntityId() == player.getEntityId();
  if (!isUser || otherorigin) {
    Vector velocity=entity.getVelocity();
    double max=maxspeed;
    double factor=pushfactor;
    if (AvatarState.isAvatarState(player)) {
      max=AvatarState.getValue(maxspeed);
      factor=AvatarState.getValue(factor);
    }
    Vector push=direction.clone();
    if (Math.abs(push.getY()) > max && !isUser) {
      if (push.getY() < 0)       push.setY(-max);
 else       push.setY(max);
    }
    factor*=1 - location.distance(origin) / (2 * range);
    if (isUser && Methods.isSolid(player.getLocation().add(0,-.5,0).getBlock())) {
      factor*=.5;
    }
    double comp=velocity.dot(push.clone().normalize());
    if (comp > factor) {
      velocity.multiply(.5);
      velocity.add(push.clone().normalize().multiply(velocity.clone().dot(push.clone().normalize())));
    }
 else     if (comp + factor * .5 > factor) {
      velocity.add(push.clone().multiply(factor - comp));
    }
 else {
      velocity.add(push.clone().multiply(factor * .5));
    }
    if (entity instanceof Player) {
      if (Commands.invincible.contains(((Player)entity).getName()))       return;
    }
    Methods.setVelocity(entity,velocity);
    entity.setFallDistance(0);
    if (!isUser && entity instanceof Player) {
      new Flight((Player)entity,player);
    }
    if (entity.getFireTicks() > 0)     entity.getWorld().playEffect(entity.getLocation(),Effect.EXTINGUISH,0);
    entity.setFireTicks(0);
    Methods.breakBreathbendingHold(entity);
    if (damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedentities.contains(entity)) {
      Methods.damageEntity(player,entity,damage);
      affectedentities.add(entity);
    }
  }
}

Fixed version (ground truth):
private void affect(Entity entity){
  boolean isUser=entity.getEntityId() == player.getEntityId();
  if (!isUser || otherorigin) {
    Vector velocity=entity.getVelocity();
    double max=maxspeed;
    double factor=pushfactor;
    if (AvatarState.isAvatarState(player)) {
      max=AvatarState.getValue(maxspeed);
      factor=AvatarState.getValue(factor);
    }
    Vector push=direction.clone();
    if (Math.abs(push.getY()) > max && !isUser) {
      if (push.getY() < 0)       push.setY(-max);
 else       push.setY(max);
    }
    factor*=1 - location.distance(origin) / (2 * range);
    if (isUser && Methods.isSolid(player.getLocation().add(0,-.5,0).getBlock())) {
      factor*=.5;
    }
    double comp=velocity.dot(push.clone().normalize());
    if (comp > factor) {
      velocity.multiply(.5);
      velocity.add(push.clone().normalize().multiply(velocity.clone().dot(push.clone().normalize())));
    }
 else     if (comp + factor * .5 > factor) {
      velocity.add(push.clone().multiply(factor - comp));
    }
 else {
      velocity.add(push.clone().multiply(factor * .5));
    }
    if (entity instanceof Player) {
      if (Commands.invincible.contains(((Player)entity).getName()))       return;
    }
    if (Double.isNaN(velocity.length()))     return;
    Methods.setVelocity(entity,velocity);
    entity.setFallDistance(0);
    if (!isUser && entity instanceof Player) {
      new Flight((Player)entity,player);
    }
    if (entity.getFireTicks() > 0)     entity.getWorld().playEffect(entity.getLocation(),Effect.EXTINGUISH,0);
    entity.setFireTicks(0);
    Methods.breakBreathbendingHold(entity);
    if (damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedentities.contains(entity)) {
      Methods.damageEntity(player,entity,damage);
      affectedentities.add(entity);
    }
  }
}