25 lines
642 B
Java
25 lines
642 B
Java
/*
|
|
* Copyright (C) 2025 Minecon724
|
|
* Tweaks724 is licensed under the GNU General Public License. See the LICENSE.md file
|
|
* in the project root for the full license text.
|
|
*/
|
|
|
|
package eu.m724.tweaks.module.ping;
|
|
|
|
import org.bukkit.plugin.Plugin;
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
public class MsptChecker extends BukkitRunnable {
|
|
private long lastLoop = 0;
|
|
|
|
@Override
|
|
public void run() {
|
|
long now = System.nanoTime();
|
|
PlayerPingStorage.submitNspt((now - lastLoop) / 40);
|
|
lastLoop = now;
|
|
}
|
|
|
|
public void init(Plugin plugin) {
|
|
this.runTaskTimer(plugin, 0, 40); // 2 secs
|
|
}
|
|
}
|