Update notifications! For dev, stable-dev, and bukkit channels! :)

This commit is contained in:
graywolf336
2014-07-21 18:17:30 -05:00
parent 6fe5eeb346
commit 1c92f90ccc
11 changed files with 284 additions and 9 deletions

View File

@ -110,10 +110,23 @@ public class Util {
return wand;
}
/**
*
* Converts a string like '20minutes' into the appropriate amount of the given unit.
*
* @param time in a string to convert.
* @param unit which to convert to.
* @return The time in the unit given that is converted.
* @throws Exception if there are no matches
*/
public static Long getTime(String time, TimeUnit unit) throws Exception {
return unit.convert(getTime(time), TimeUnit.MILLISECONDS);
}
/**
* Converts a string like '20minutes' into the appropriate amount of milliseconds.
*
* @param time The string to convert.
* @param time in a string to convert.
* @return The time in milliseconds that is converted.
* @throws Exception if there are no matches
*/
@ -144,7 +157,7 @@ public class Util {
throw new Exception("Invalid format.");
}
return Long.valueOf(t);
return t;
}
/**