T2C-AutomatedMessages/src/main/java/net/t2code/automatedMessages/messages/Timer.java
2023-06-27 19:13:21 +02:00

22 lines
615 B
Java

package net.t2code.automatedMessages.messages;
import net.t2code.automatedMessages.objects.Message;
import net.t2code.automatedMessages.system.Main;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
public class Timer {
public Timer(@NotNull Message message) {
Bukkit.getScheduler().scheduleAsyncRepeatingTask(Main.getPlugin(), new Runnable() {
@Override
public void run() {
if (disable) return;
SendMessage.send(message);
}
}, 0, 20L * 60 * message.interval);
}
public Boolean disable = false;
}