diff --git a/src/com/garbagemule/MobArena/util/timer/Common.java b/src/com/garbagemule/MobArena/util/timer/Common.java new file mode 100644 index 0000000..e7ef62a --- /dev/null +++ b/src/com/garbagemule/MobArena/util/timer/Common.java @@ -0,0 +1,23 @@ +package com.garbagemule.MobArena.util.timer; + +public class Common { + /** + * Convert seconds to ticks. + * + * @param seconds value to convert + * @return the value converted to ticks + */ + public static long toTicks(int seconds) { + return seconds * 20l; + } + + /** + * Convert ticks to seconds. + * + * @param ticks value to convert + * @return the value converted to seconds + */ + public static int toSeconds(long ticks) { + return (int) (ticks / 20l); + } +}