Skip to content

Commit

Permalink
map handling and meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 17, 2022
1 parent e5e9c6a commit eaf0dbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -27,7 +27,7 @@ public class MapCommand extends AbstractCommand {

public MapCommand() {
setName("map");
setSyntax("map [<#>/new:<world>] (reset:<location>) (scale:<value>) (tracking) (image:<file>) (resize) (script:<script>) (dot:<color>) (radius:<radius>) (x:<#>) (y:<#>)");
setSyntax("map [<#>/new:<world>] (reset:<location>) (scale:<value>) (tracking) (image:<file>) (resize) (script:<script>) (dot:<color>) (radius:<#>) (x:<#>) (y:<#>)");
setRequiredArguments(2, 9);
isProcedural = false;
setPrefixesHandled("dot", "radius", "image", "script", "x", "y", "reset", "new");
Expand All @@ -36,7 +36,7 @@ public MapCommand() {

// <--[command]
// @Name Map
// @Syntax map [<#>/new:<world>] (reset:<location>) (scale:<value>) (tracking) (image:<file>) (resize) (script:<script>) (dot:<color>) (radius:<radius>) (x:<#>) (y:<#>)
// @Syntax map [<#>/new:<world>] (reset:<location>) (scale:<value>) (tracking) (image:<file>) (resize) (script:<script>) (dot:<color>) (radius:<#>) (x:<#>) (y:<#>)
// @Required 2
// @Maximum 9
// @Short Modifies a new or existing map by adding images or text.
Expand All @@ -49,7 +49,7 @@ public MapCommand() {
//
// When using 'reset', you can specify optionally 'scale' and/or 'tracking'.
// When using 'image' you can optionally specify 'resize'.
// When using 'dot' you can optionally specify 'radius'.
// When using 'dot', you can specify any valid ColorTag (it will be compressed to map's color space), and you can optionally also specify 'radius' as a number.
//
// You can reset this at any time by using the 'reset:<location>' argument, which will remove all
// images and texts on the map and show the default world map at the specified location.
Expand Down
Expand Up @@ -222,7 +222,7 @@ private static String downloadImage(URL url) {
BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
int lastDot = urlString.lastIndexOf('.');
String fileName = String.format("%0" + (6 - String.valueOf(downloadCount).length()) + "d", downloadCount)
+ (lastDot > 0 ? allowedExtensionText.trimToMatches(urlString.substring(lastDot)) : "");
+ (lastDot > 0 ? "." + allowedExtensionText.trimToMatches(urlString.substring(lastDot)) : "");
File output = new File(imageDownloads, fileName);
FileImageOutputStream out = new FileImageOutputStream(output);
int i;
Expand Down

0 comments on commit eaf0dbe

Please sign in to comment.