From 6a181abdcb3c8f668af9f08dca4b9199f78b6ade Mon Sep 17 00:00:00 2001 From: Orinion Date: Fri, 30 Aug 2019 02:43:59 +0200 Subject: [PATCH] Check if waypoint name is Tag before, saving a waypint with a tag name would not result in an error, but you would not be able to run "goto" on it. see #869 --- .../java/baritone/api/utils/ExampleBaritoneControl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 16a56667..263349ef 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -576,6 +576,13 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener } name = parts[0]; } + for (IWaypoint.Tag tag : IWaypoint.Tag.values()) + { + if (tag.name().equalsIgnoreCase(name)) { + logDirect("Unable to use Tags as name. Tags are: " + Arrays.asList(IWaypoint.Tag.values()).toString().toLowerCase()); + return true; + } + } baritone.getWorldProvider().getCurrentWorld().getWaypoints().addWaypoint(new Waypoint(name, IWaypoint.Tag.USER, pos)); logDirect("Saved user defined position " + pos + " under name '" + name + "'. Say 'goto " + name + "' to set goal, say 'list user' to list custom waypoints."); return true;