Add Tick util class
This commit is contained in:
		
							
								
								
									
										30
									
								
								src/main/java/fr/pandacube/util/measurement/Tick.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/java/fr/pandacube/util/measurement/Tick.java
									
									
									
									
									
										Normal 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; | ||||
| 	} | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user