Renamed directory to anticope
This commit is contained in:
32
src/main/java/anticope/rejects/utils/RejectsUtils.java
Normal file
32
src/main/java/anticope/rejects/utils/RejectsUtils.java
Normal file
@@ -0,0 +1,32 @@
|
||||
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