Buggy code:
public class WaypointCommands implements CommandExecutor { private WaypointModule module ; public WaypointCommands ( WaypointModule module ) { } @ Command ( value = "waypoint" , desc = "Setzt<seq2seq4repair_space>einen<seq2seq4repair_space>Waypoint." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointCreate ( CommandSender sender , String command , String [ ] args ) { } @ Command ( value = "waypointconnectstart" , desc = "Laufe<seq2seq4repair_space>eine<seq2seq4repair_space>Strecke<seq2seq4repair_space>ab<seq2seq4repair_space>zwischen<seq2seq4repair_space>zwei<seq2seq4repair_space>Wegpunkten." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointConnectionRecordingStart ( CommandSender sender , String command , String [ ] args ) { } @ Command ( value = "waypointconnectstop" , desc = "Bricht<seq2seq4repair_space>das<seq2seq4repair_space>aktuelle<seq2seq4repair_space>Recording<seq2seq4repair_space>ab." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointConnectionRecordingStop ( CommandSender sender , String command , String [ ] args ) { } @ Command ( value = "waypointsave" , desc = "Speichert<seq2seq4repair_space>alle<seq2seq4repair_space>Wegpunkte<seq2seq4repair_space>in<seq2seq4repair_space>eine<seq2seq4repair_space>Datei<seq2seq4repair_space>ab." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointSave ( CommandSender sender , String command , String [ ] args ) { } @ Command ( value = "waypointload" , desc = "Lädt<seq2seq4repair_space>die<seq2seq4repair_space>Configuration<seq2seq4repair_space>der<seq2seq4repair_space>Waypoints." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointLoad ( CommandSender sender , String command , String [ ] args ) { } @ Command ( value = "gps" , desc = "Berechnet<seq2seq4repair_space>die<seq2seq4repair_space>Route<seq2seq4repair_space>durch<seq2seq4repair_space>die<seq2seq4repair_space>Waypoints." , perm = "craftoplugin.default" , onlyplayers = true ) public void calcWay ( CommandSender sender , String command , String [ ] args ) { Player player = ( ( Player ) ( sender ) ) ; if ( ( args . length ) < 1 ) { CraftoMessenger . sendFailed ( sender , "//gps<seq2seq4repair_space><to>" ) ; return ; } HashMap < String , Waypoint > waypointsByName = this . module . getWaypointsByName ( ) ; int from = 0 ; int to = 0 ; if ( waypointsByName . containsKey ( args [ 0 ] . toLowerCase ( ) ) ) { to = waypointsByName . get ( args [ 0 ] . toLowerCase ( ) ) . getIndex ( ) ; } else { try { to = Integer . parseInt ( args [ 0 ] ) ; } catch ( NumberFormatException e ) { } } double minDist = 125.0 ; Position pPos = new Position ( player . getLocation ( ) ) ; for ( Waypoint wp : this . module . getWaypoints ( ) ) { double dist = wp . toPosition ( ) . getDistance ( pPos ) ; if ( dist < minDist ) { <START_BUG> dist = minDist ; <END_BUG> from = wp . getIndex ( ) ; } } if ( ( from == 0 ) || ( to == 0 ) ) { CraftoMessenger . sendFailed ( sender , "//gps<seq2seq4repair_space><to><seq2seq4repair_space>where<seq2seq4repair_space>to<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>waypoint" ) ; return ; } long calcTimeStart = System . currentTimeMillis ( ) ; WaypointPath path = this . module . getPathFinder ( ) . search ( to , from ) ; CraftoMessenger . debug ( ( ( ( System . currentTimeMillis ( ) ) - calcTimeStart ) + "<seq2seq4repair_space>ms<seq2seq4repair_space>calculation<seq2seq4repair_space>time..." ) ) ; if ( path . isEmpty ( ) ) { CraftoMessenger . sendMessage ( sender , "Kein<seq2seq4repair_space>Weg<seq2seq4repair_space>gefunden." ) ; } else { CraftoMessenger . sendMessage ( sender , "Weg<seq2seq4repair_space>gefunden:" ) ; for ( WaypointElement wp : path ) { if ( wp instanceof Waypoint ) { CraftoMessenger . sendMessage ( sender , ( "->" + ( wp . toString ( ) ) ) ) ; } } this . module . setPath ( player , path ) ; } } @ Command ( value = "waypointdebug" , desc = "Zeigt<seq2seq4repair_space>alle<seq2seq4repair_space>Wegpunkte<seq2seq4repair_space>und<seq2seq4repair_space>Pfade<seq2seq4repair_space>an." , perm = "craftoplugin.admin" , onlyplayers = true ) public void onWaypointsDebug ( CommandSender sender , String command , String [ ] args ) { } @ Override public Module getModule ( ) { } }

Fix:
minDist = dist ;