Add TPSWatcher.getTPSLimited #92
@ -29,7 +29,7 @@ public class TPSWatcher {
|
||||
private static final TPSWatcher tps_TenSecond = new TPSWatcher(10000);
|
||||
|
||||
private long lastTime = System.currentTimeMillis();
|
||||
private double tps = 20.0;
|
||||
private double tps = TICK_DEFAULT;
|
||||
|
||||
private TPSWatcher(long timeInterval) {
|
||||
Bukkit.getScheduler().runTaskTimer(Core.getInstance(), () -> {
|
||||
@ -46,12 +46,20 @@ public class TPSWatcher {
|
||||
return getTPS(TPSType.ONE_SECOND);
|
||||
}
|
||||
|
||||
public static double getTPS(double limit) {
|
||||
return getTPS(TPSType.ONE_SECOND, limit);
|
||||
}
|
||||
|
||||
public static double getTPSUnlimited() {
|
||||
return getTPSUnlimited(TPSType.ONE_SECOND);
|
||||
}
|
||||
|
||||
public static double getTPS(TPSType tpsType) {
|
||||
return Math.min(getTPSUnlimited(tpsType), 20.0);
|
||||
return getTPS(tpsType, TICK_DEFAULT);
|
||||
}
|
||||
|
||||
public static double getTPS(TPSType tpsType, double limit) {
|
||||
return Math.min(getTPSUnlimited(tpsType), limit);
|
||||
}
|
||||
|
||||
public static double getTPSUnlimited(TPSType tpsType) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren