31 lines
1.2 KiB
Java
31 lines
1.2 KiB
Java
// This claas was created by JaTiTV
|
|
|
|
package net.t2code.opsecurity.check;
|
|
|
|
import net.t2code.opsecurity.config.config.Config;
|
|
import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
|
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
|
import net.t2code.opsecurity.system.Main;
|
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class Timer {
|
|
|
|
public static void refreshTimer() {
|
|
if (!((boolean)OPWhitelist.VALUES.enable.getValue() && (boolean)PermissionWhitelist.VALUES.enable.getValue())) return;
|
|
if (!(boolean) Config.VALUES.checkTimerEnable.getValue()) return;
|
|
|
|
Bukkit.getScheduler().scheduleAsyncRepeatingTask(Main.getPlugin(), new Runnable() {
|
|
@Override
|
|
public void run() {
|
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
String debug = T2Cdebug.debugCode();
|
|
OpCheck.onCheck(player, false, debug);
|
|
PermissionCheck.onCheck(player, false, debug);
|
|
}
|
|
}
|
|
}, 0, 20L * (int) Config.VALUES.checkTimerRefreshInSec.getValue());
|
|
}
|
|
}
|