Add Tick util class

This commit is contained in:
Marc Baloup 2021-03-06 16:51:53 +01:00
parent 574ef6e4d0
commit 3c3ba8bca3
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893
1 changed files with 30 additions and 0 deletions

View File

@ -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;
}
}