com.exaroton.api.ws.data.TickData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
The official exaroton java library
package com.exaroton.api.ws.data;
public class TickData {
private double averageTickTime;
/**
* get average tick time
* @return average tick time in ms
*/
public double getAverageTickTime() {
return averageTickTime;
}
/**
* calculate tps (ticks per second)
* 1000 / tick time (limit = 20)
* @return calculated tps
*/
public double calculateTPS() {
if (this.averageTickTime < 50) return 20;
return 1000 / this.averageTickTime;
}
}