fix 1.18.2 (fixes #109)

This commit is contained in:
C10udburst
2022-03-02 17:27:52 +01:00
parent e4006cfa3b
commit 6d3f5c0856
7 changed files with 4 additions and 64 deletions

View File

@@ -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();
}
};
}
}