diff --git a/src/main/java/org/dynmap/markers/MarkerSet.java b/src/main/java/org/dynmap/markers/MarkerSet.java index 4d0f6d68..f1ac9619 100644 --- a/src/main/java/org/dynmap/markers/MarkerSet.java +++ b/src/main/java/org/dynmap/markers/MarkerSet.java @@ -35,6 +35,12 @@ public interface MarkerSet { * @return marker, or null if cannot be found */ public Marker findMarker(String id); + /** + * Find marker by label - best matching substring + * @param lbl - label to find (same = best match) + * @return marker, or null if none found + */ + public Marker findMarkerByLabel(String lbl); /** * Get ID of marker set - unique among marker sets * @return ID diff --git a/src/main/java/org/dynmap/markers/impl/MarkerAPIImpl.java b/src/main/java/org/dynmap/markers/impl/MarkerAPIImpl.java index 74ab33fc..ec655dcb 100644 --- a/src/main/java/org/dynmap/markers/impl/MarkerAPIImpl.java +++ b/src/main/java/org/dynmap/markers/impl/MarkerAPIImpl.java @@ -409,7 +409,7 @@ public class MarkerAPIImpl implements MarkerAPI, Event.Listener { "add", "movehere", "update", "delete", "list", "icons" })); - /* Parse argument strings : handle 'attrib=value' and quoted strings */ + /* Parse argument strings : handle 'attrib:value' and quoted strings */ private static Map parseArgs(String[] args, CommandSender snd) { HashMap rslt = new HashMap(); /* Build command line, so we can parse our way - make sure there is trailing space */ @@ -438,7 +438,7 @@ public class MarkerAPIImpl implements MarkerAPI, Event.Listener { sb.append(c); } } - else if(c == '=') { /* var=value */ + else if(c == ':') { /* var:value */ varid = sb.toString(); /* Save variable ID */ sb.setLength(0); } @@ -513,7 +513,7 @@ public class MarkerAPIImpl implements MarkerAPI, Event.Listener { sender.sendMessage("Error creating marker"); } else { - sender.sendMessage("Added marker id='" + m.getMarkerID() + "' (" + m.getLabel() + ") to set '" + set.getMarkerSetID() + "'"); + sender.sendMessage("Added marker id:'" + m.getMarkerID() + "' (" + m.getLabel() + ") to set '" + set.getMarkerSetID() + "'"); } } else { @@ -529,8 +529,8 @@ public class MarkerAPIImpl implements MarkerAPI, Event.Listener { /* Parse arguements */ Map parms = parseArgs(args, sender); if(parms == null) return true; - if(parms.get("id") == null) { - sender.sendMessage("id= required"); + if((parms.get("id") == null) && (parms.get("label") == null)) { + sender.sendMessage("