Program: 178803
Project: 178803
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled())   return;
  Player player=event.getPlayer();
  Vector vector=player.getVelocity();
  Block loc=event.getTo().getBlock();
  Region regionTo=RegionManager.getRegion(event.getTo());
  Region regionFrom=RegionManager.getRegion(event.getFrom());
  User user=PortalStick.players.get(player.getName());
  PortalManager.checkPlayerMove(player,regionFrom,regionTo);
  if (loc.getType() == Material.SUGAR_CANE_BLOCK && regionTo.getBoolean(RegionSetting.ENABLE_GRILL)) {
    for (    Grill grill : GrillManager.grills) {
      if (grill.getInside().contains(loc)) {
        if (user != null) {
          if (user.getBluePortal() != null)           user.getBluePortal().delete();
          if (user.getOrangePortal() != null)           user.getOrangePortal().delete();
        }
        if (regionTo.getBoolean(RegionSetting.GRILLS_CLEAR_INVENTORY)) {
          PortalManager.setPortalInventory(player);
        }
      }
    }
  }
  if (player.isInsideVehicle())   return;
  if (!Permission.teleport(player))   return;
  double addX=0.0;
  double addY=0.0;
  double addZ=0.0;
  if (Math.abs(vector.getX()) > 1) {
    addX+=3.0;
    addY+=2.0;
    addZ+=2.0;
  }
  if (Math.abs(vector.getZ()) > 1) {
    addX+=2.0;
    addY+=2.0;
    addZ+=3.0;
  }
  if (Math.abs(vector.getY()) > 1) {
    addX+=2.0;
    addY+=3.0;
    addZ+=2.0;
  }
  Portal portal=null;
  for (  Portal p : PortalManager.portals) {
    for (    Block b : p.getInside()) {
      if (offsetequals(b.getLocation().getX(),loc.getX(),addX) && offsetequals(b.getLocation().getZ(),loc.getZ(),addZ) && offsetequals(b.getLocation().getY(),loc.getY(),addY)) {
        portal=p;
        break;
      }
    }
  }
  if (portal != null) {
    if (!portal.isOpen() || portal.isDisabled())     return;
    User owner=portal.getOwner();
    Location teleport;
    Portal destination;
    if (portal.isOrange())     destination=owner.getBluePortal();
 else     destination=owner.getOrangePortal();
    teleport=destination.getTeleportLocation().clone();
    float yaw=0;
    float pitch=0;
    Double momentum=0.0;
switch (portal.getTeleportFace()) {
case NORTH:
case SOUTH:
      momentum=vector.getX();
    break;
case EAST:
case WEST:
  momentum=vector.getZ();
break;
case UP:
case DOWN:
momentum=vector.getY();
break;
}
momentum=Math.abs(momentum);
momentum=momentum * regionTo.getInt(RegionSetting.VELOCITY_MULTIPLIER);
Vector outvector=player.getVelocity().zero();
switch (destination.getTeleportFace()) {
case NORTH:
yaw=270;
outvector=outvector.setX(momentum);
break;
case EAST:
yaw=0;
outvector=outvector.setZ(momentum);
break;
case SOUTH:
yaw=90;
outvector=outvector.setX(-momentum);
break;
case WEST:
yaw=180;
outvector=outvector.setZ(-momentum);
break;
case UP:
pitch=90;
outvector=outvector.setY(momentum);
break;
case DOWN:
pitch=-90;
outvector=outvector.setY(-momentum);
break;
}
player.setFallDistance(0);
player.setVelocity(player.getVelocity().zero());
teleport.setPitch(pitch);
teleport.setYaw(yaw);
event.setTo(teleport);
player.teleport(teleport);
player.setVelocity(outvector);
destination.setDisabled(true);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new EnablePortal(destination),10L);
}
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled())   return;
  Player player=event.getPlayer();
  Vector vector=player.getVelocity();
  Block loc=event.getTo().getBlock();
  Region regionTo=RegionManager.getRegion(event.getTo());
  Region regionFrom=RegionManager.getRegion(event.getFrom());
  User user=PortalStick.players.get(player.getName());
  PortalManager.checkPlayerMove(player,regionFrom,regionTo);
  if (loc.getType() == Material.SUGAR_CANE_BLOCK && regionTo.getBoolean(RegionSetting.ENABLE_GRILL)) {
    for (    Grill grill : GrillManager.grills) {
      if (grill.getInside().contains(loc)) {
        if (user != null) {
          if (user.getBluePortal() != null)           user.getBluePortal().delete();
          if (user.getOrangePortal() != null)           user.getOrangePortal().delete();
        }
        if (regionTo.getBoolean(RegionSetting.GRILLS_CLEAR_INVENTORY)) {
          PortalManager.setPortalInventory(player);
        }
      }
    }
  }
  if (player.isInsideVehicle())   return;
  if (!Permission.teleport(player))   return;
  double addX=0.0;
  double addY=0.0;
  double addZ=0.0;
  if (Math.abs(vector.getX()) > 1) {
    addX+=3.0;
    addY+=2.0;
    addZ+=2.0;
  }
  if (Math.abs(vector.getZ()) > 1) {
    addX+=2.0;
    addY+=2.0;
    addZ+=3.0;
  }
  if (Math.abs(vector.getY()) > 1) {
    addX+=2.0;
    addY+=3.0;
    addZ+=2.0;
  }
  Portal portal=null;
  for (  Portal p : PortalManager.portals) {
    for (    Block b : p.getInside()) {
      if (offsetequals(b.getLocation().getX(),loc.getX(),addX) && offsetequals(b.getLocation().getZ(),loc.getZ(),addZ) && offsetequals(b.getLocation().getY(),loc.getY(),addY)) {
        portal=p;
        break;
      }
    }
  }
  if (portal != null) {
    if (!portal.isOpen() || portal.isDisabled())     return;
    User owner=portal.getOwner();
    Location teleport;
    Portal destination;
    if (portal.isOrange())     destination=owner.getBluePortal();
 else     destination=owner.getOrangePortal();
    teleport=destination.getTeleportLocation().clone();
    float yaw=0;
    float pitch=0;
    Double momentum=0.0;
switch (portal.getTeleportFace()) {
case NORTH:
case SOUTH:
      momentum=vector.getX();
    break;
case EAST:
case WEST:
  momentum=vector.getZ();
break;
case UP:
case DOWN:
momentum=vector.getY();
break;
}
momentum=Math.abs(momentum);
momentum=momentum * regionTo.getDouble(RegionSetting.VELOCITY_MULTIPLIER);
Vector outvector=player.getVelocity().zero();
switch (destination.getTeleportFace()) {
case NORTH:
yaw=270;
outvector=outvector.setX(momentum);
break;
case EAST:
yaw=0;
outvector=outvector.setZ(momentum);
break;
case SOUTH:
yaw=90;
outvector=outvector.setX(-momentum);
break;
case WEST:
yaw=180;
outvector=outvector.setZ(-momentum);
break;
case UP:
pitch=90;
outvector=outvector.setY(momentum);
break;
case DOWN:
pitch=-90;
outvector=outvector.setY(-momentum);
break;
}
player.setFallDistance(0);
player.setVelocity(player.getVelocity().zero());
teleport.setPitch(pitch);
teleport.setYaw(yaw);
event.setTo(teleport);
player.teleport(teleport);
player.setVelocity(outvector);
destination.setDisabled(true);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new EnablePortal(destination),10L);
}
}