22 lines
615 B
Java
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;
|
|
}
|