fix 1.18.2 (fixes #109)
This commit is contained in:
@@ -3,30 +3,11 @@ package anticope.rejects.utils;
|
||||
import anticope.rejects.utils.seeds.Seeds;
|
||||
import meteordevelopment.meteorclient.MeteorClient;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class RejectsUtils {
|
||||
public static int CPS = 0;
|
||||
|
||||
public static void init() {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
RejectsConfig.get().save(MeteorClient.FOLDER);
|
||||
Seeds.get().save(MeteorClient.FOLDER);
|
||||
}));
|
||||
|
||||
new Timer().scheduleAtFixedRate(newTimerTaskFromLambda(() -> CPS = 0), 0, 1000);
|
||||
}
|
||||
|
||||
public static TimerTask newTimerTaskFromLambda(Runnable runnable)
|
||||
{
|
||||
return new TimerTask()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
runnable.run();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user