From 142cc3406095d76fdabeecbf1880c8e1b93f94dd Mon Sep 17 00:00:00 2001 From: sommerlilie Date: Tue, 13 Nov 2018 19:27:26 +0100 Subject: [PATCH] Update Commandline --- .idea/workspace.xml | 185 +++++++++--------- .../CommandLineMain.java | 8 +- .../morlok8k/MinecraftLandGenerator/Time.java | 140 ------------- 3 files changed, 97 insertions(+), 236 deletions(-) delete mode 100644 src/main/java/morlok8k/MinecraftLandGenerator/Time.java diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1b43e6e..11b2716 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,9 @@ - - - - + + @@ -38,27 +36,27 @@ - + - + - + - + @@ -70,25 +68,19 @@ - + + + + - - - - - - - - - - + - - + + @@ -111,12 +103,13 @@ - + - - + + + @@ -133,6 +126,18 @@ + + + + + + + + + + + + @@ -145,8 +150,8 @@ - - + + @@ -233,6 +238,7 @@ @@ -331,14 +337,6 @@ - - - - - - - - @@ -471,7 +469,7 @@ - + @@ -490,11 +488,10 @@ - - - + @@ -669,13 +666,6 @@ - - - - - - - @@ -704,16 +694,6 @@ - - - - - - - - - - @@ -721,13 +701,6 @@ - - - - - - - @@ -735,13 +708,6 @@ - - - - - - - @@ -749,13 +715,6 @@ - - - - - - - @@ -763,20 +722,6 @@ - - - - - - - - - - - - - - @@ -786,15 +731,71 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/CommandLineMain.java b/src/main/java/morlok8k/MinecraftLandGenerator/CommandLineMain.java index 25ccaba..69ec2b3 100644 --- a/src/main/java/morlok8k/MinecraftLandGenerator/CommandLineMain.java +++ b/src/main/java/morlok8k/MinecraftLandGenerator/CommandLineMain.java @@ -8,7 +8,7 @@ import picocli.CommandLine.Command; import picocli.CommandLine.HelpCommand; import java.nio.file.Path; -@Command(name = "mgl", subcommands = { +@Command(name = "mlg", subcommands = { HelpCommand.class}) public class CommandLineMain implements Runnable{ @@ -24,13 +24,13 @@ public class CommandLineMain implements Runnable{ @Parameters(index = "2", description = "path to the directory in which the server runs") private Path serverPath; - @Option(names = "-i", description = "override the iteration spawn offset increment") + @Option(names = "-i", description = "override the iteration spawn offset increment", defaultValue = "380", showDefaultValue = CommandLine.Help.Visibility.ALWAYS) private int increment = 380; - @Option(names = "-i", description = "set the X offset to generate land around") + @Option(names = {"--x-offset", "-xoff"}, description = "set the X offset to generate land around") private int xOffset = 0; - @Option(names = "-i", description = "set the Z offset to generate land around") + @Option(names = {"--y-offset", "-yoff"}, description = "set the Z offset to generate land around") private int zOffset = 0; diff --git a/src/main/java/morlok8k/MinecraftLandGenerator/Time.java b/src/main/java/morlok8k/MinecraftLandGenerator/Time.java deleted file mode 100644 index 713a0ca..0000000 --- a/src/main/java/morlok8k/MinecraftLandGenerator/Time.java +++ /dev/null @@ -1,140 +0,0 @@ -/* -####################################################################### -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# Version 2, December 2004 # -# # -# Copyright (C) 2004 Sam Hocevar # -# # -# Everyone is permitted to copy and distribute verbatim or modified # -# copies of this license document, and changing it is allowed as long # -# as the name is changed. # -# # -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # -# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # -# # -# 0. You just DO WHAT THE FUCK YOU WANT TO. # -# # -####################################################################### -*//* - - -package morlok8k.MinecraftLandGenerator; - -*/ -/** - * - * @author morlok8k - *//* - -public class Time { - -*/ -/* *//* -*/ -/** - * Returns the time in a readable format given a time in Millis. - * - * @param timeMillis - * @author Morlok8k - * @return String of Readable Time - *//* -*/ -/* - public static String displayTime(final long timeMillis) { - - final long seconds = timeMillis / 1000; - final long minutes = seconds / 60; - final long hours = minutes / 60; - final long days = hours / 24; - final long years = days / 365; - - String took = - (years > 0 ? String.format("%d " + ((years) == 1 ? "Year, " : "Years, "), years) - : "") - + (days > 0 ? String.format("%d " - + ((days % 365) == 1 ? "Day, " : "Days, "), days % 365) : "") - + (hours > 0 ? String.format("%d " - + ((hours % 24) == 1 ? "Hour, " : "Hours, "), hours % 24) : "") - + (minutes > 0 ? String.format("%d " - + ((minutes % 60) == 1 ? "Minute, " : "Minutes, "), minutes % 60) - : "") - + String.format("%d " + ((seconds % 60) == 1 ? "Second" : "Seconds"), - seconds % 60); - - if (!(var.verbose)) { - final int commaFirst = took.indexOf(","); - final int commaSecond = took.substring((commaFirst + 1), took.length()).indexOf(","); - int end = (commaFirst + 1 + commaSecond); - - if (commaSecond == -1) { - end = commaFirst; - } - - if (commaFirst == -1) { - end = took.length(); - } - - took = took.substring(0, end); - } - - took = took.trim(); - return (took); - } - - *//* -*/ -/** - * Returns the time in a readable format between two points of time given in Millis. - * - * @param startTimeMillis - * @param endTimeMillis - * @author Morlok8k - * @return String of Readable Time - *//* -*/ -/* - public static String displayTime(final long startTimeMillis, final long endTimeMillis) { - - final long millis = (endTimeMillis - startTimeMillis); - //I just duplicated displayTime to have a start & end times, because it just made things simpler to code. - return (Time.displayTime(millis)); - }*//* - - - */ -/** - * waits ten seconds. outputs 10%, 20%, etc after each second. - * - * @param output - * @author Morlok8k - *//* - - public static void waitTenSec(final boolean output) { - - if (var.dontWait) { return; } //Don't wait! - - if (output) { - log.infoP(var.MLG); //here we wait 10 sec. - } - - int count = 0; - while (count <= 100) { - if (output) { - log.infoP(count + "% "); - } - - try { - Thread.sleep(1000); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - count += 10; - } - if (output) { - log.infoP(var.newLine); - } - return; - - } -} -*/