From 3c3ba8bca3c2cf9f7ac3898473670d1512a681d8 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sat, 6 Mar 2021 16:51:53 +0100 Subject: [PATCH] Add Tick util class --- .../fr/pandacube/util/measurement/Tick.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/fr/pandacube/util/measurement/Tick.java diff --git a/src/main/java/fr/pandacube/util/measurement/Tick.java b/src/main/java/fr/pandacube/util/measurement/Tick.java new file mode 100644 index 0000000..373ff2c --- /dev/null +++ b/src/main/java/fr/pandacube/util/measurement/Tick.java @@ -0,0 +1,30 @@ +package fr.pandacube.util.measurement; + +public class Tick { + + + /** + * Returns the number of tick is the provided duration, in second + * @param seconds the duration in second + * @return the same duration as provided, but in Minecraft server ticks + */ + public static long sec(long seconds) { + return seconds * 20; + } + + /** + * Returns the number of tick is the provided duration, in second + * @param seconds the duration in second + * @return the same duration as provided, but in Minecraft server ticks + */ + public static long min(long minutes) { + return minutes * 1200; + } + + + + + + + +}