add save command

This commit is contained in:
Leijurv 2018-09-13 09:15:50 -07:00
parent 4c5c35069d
commit 530bdfae0f
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -19,8 +19,8 @@ package baritone.utils;
import baritone.Baritone;
import baritone.Settings;
import baritone.api.event.events.ChatEvent;
import baritone.api.behavior.Behavior;
import baritone.api.event.events.ChatEvent;
import baritone.behavior.FollowBehavior;
import baritone.behavior.MineBehavior;
import baritone.behavior.PathingBehavior;
@ -41,7 +41,7 @@ import net.minecraft.util.math.BlockPos;
import java.util.*;
public class ExampleBaritoneControl extends Behavior implements Helper {
public class ExampleBaritoneControl extends Behavior implements Helper {
public static ExampleBaritoneControl INSTANCE = new ExampleBaritoneControl();
@ -238,6 +238,13 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
event.cancel();
return;
}
if (msg.toLowerCase().equals("save")) {
String name = msg.substring(4).trim();
WorldProvider.INSTANCE.getCurrentWorld().waypoints.addWaypoint(new Waypoint(name, Waypoint.Tag.HOME, playerFeet()));
logDirect("Saved user defined tag under name '" + name + "'. Say 'goto user' to set goal, say 'list user' to list.");
event.cancel();
return;
}
if (msg.toLowerCase().startsWith("goto")) {
String waypointType = msg.toLowerCase().substring(4).trim();
if (waypointType.endsWith("s") && Waypoint.Tag.fromString(waypointType.substring(0, waypointType.length() - 1)) != null) {