2022-07-20 13:18:57 +02:00
|
|
|
package fr.pandacube.lib.util;
|
2021-03-06 16:51:53 +01:00
|
|
|
|
2022-07-28 01:13:35 +02:00
|
|
|
/**
|
|
|
|
* Provides methods related to Minecraft Java server ticks.
|
|
|
|
*/
|
2021-03-06 16:51:53 +01:00
|
|
|
public class Tick {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-07-28 01:13:35 +02:00
|
|
|
* Returns the number of tick is the provided number of seconds.
|
2021-03-06 16:51:53 +01:00
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-07-28 01:13:35 +02:00
|
|
|
* Returns the number of tick is the provided number of minutes.
|
2022-07-10 00:55:56 +02:00
|
|
|
* @param minutes the duration in minutes
|
2021-03-06 16:51:53 +01:00
|
|
|
* @return the same duration as provided, but in Minecraft server ticks
|
|
|
|
*/
|
|
|
|
public static long min(long minutes) {
|
|
|
|
return minutes * 1200;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|