Merge pull request #2020 from ZacSharp/wpgoto

make `#wp goto` behave like `#wp goal` and `#path`
This commit is contained in:
Leijurv 2020-09-29 16:55:50 -07:00 committed by GitHub
commit 8ddc795158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -63,7 +63,7 @@ public final class DefaultCommands {
new ThisWayCommand(baritone),
new WaypointsCommand(baritone),
new CommandAlias(baritone, "sethome", "Sets your home waypoint", "waypoints save home"),
new CommandAlias(baritone, "home", "Set goal to your home waypoint", "waypoints goal home"),
new CommandAlias(baritone, "home", "Path to your home waypoint", "waypoints goto home"),
new SelCommand(baritone)
));
ExecutionControlCommands prc = new ExecutionControlCommands(baritone);

View File

@ -235,6 +235,10 @@ public class WaypointsCommand extends Command {
Goal goal = new GoalBlock(waypoint.getLocation());
baritone.getCustomGoalProcess().setGoal(goal);
logDirect(String.format("Goal: %s", goal));
} else if (action == Action.GOTO) {
Goal goal = new GoalBlock(waypoint.getLocation());
baritone.getCustomGoalProcess().setGoalAndPath(goal);
logDirect(String.format("Going to: %s", goal));
}
}
}
@ -292,7 +296,8 @@ public class WaypointsCommand extends Command {
"> wp <s/save> <tag> <name> <pos> - Save the waypoint with the specified name and position.",
"> wp <i/info/show> <tag> - Show info on a waypoint by tag.",
"> wp <d/delete> <tag> - Delete a waypoint by tag.",
"> wp <g/goal/goto> <tag> - Set a goal to a waypoint by tag."
"> wp <g/goal> <tag> - Set a goal to a waypoint by tag.",
"> wp <goto> <tag> - Set a goal to a waypoint by tag and start pathing."
);
}
@ -302,7 +307,8 @@ public class WaypointsCommand extends Command {
SAVE("save", "s"),
INFO("info", "show", "i"),
DELETE("delete", "d"),
GOAL("goal", "goto", "g");
GOAL("goal", "g"),
GOTO("goto");
private final String[] names;
Action(String... names) {