Add more waypoint manipulation flags

This commit is contained in:
fullwall 2013-06-01 16:37:14 +08:00
parent 34c61dcc07
commit c9f51bca26

View File

@ -55,8 +55,7 @@ public class LinearWaypointProvider implements WaypointProvider {
if (args.hasFlag('h')) { if (args.hasFlag('h')) {
waypoints.add(new Waypoint(player.getLocation())); waypoints.add(new Waypoint(player.getLocation()));
return null; return null;
} } else if (args.hasValueFlag("at")) {
if (args.hasValueFlag("at")) {
try { try {
Location location = Util.parseLocation(player.getLocation(), args.getFlag("at")); Location location = Util.parseLocation(player.getLocation(), args.getFlag("at"));
waypoints.add(new Waypoint(location)); waypoints.add(new Waypoint(location));
@ -64,8 +63,15 @@ public class LinearWaypointProvider implements WaypointProvider {
Messaging.sendError(player, e.getMessage()); Messaging.sendError(player, e.getMessage());
} }
return null; return null;
} } else if (args.hasFlag('c')) {
if (args.hasFlag('p')) { waypoints.clear();
return null;
} else if (args.hasFlag('l')) {
if (waypoints.size() > 0) {
waypoints.remove(waypoints.size() - 1);
}
return null;
} else if (args.hasFlag('p')) {
setPaused(!isPaused()); setPaused(!isPaused());
return null; return null;
} }