diff --git a/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java b/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java index 28b7d8d..38ebcf2 100644 --- a/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java +++ b/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java @@ -22,7 +22,7 @@ public final class DonPayIntegPlug extends JavaPlugin { scheduler.runTaskTimer(this, () -> { thread.set(new DonateThread(this.getLogger())); thread.get().start(); - }, 1, 20 * 15); + }, 1, 20 * ConfigHandler.load().getReqPerSec()); scheduler.runTaskTimer(this, () -> { if (!commands.isEmpty()) { this.getServer().dispatchCommand(Bukkit.getConsoleSender(), commands.getFirst()); diff --git a/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java b/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java index 9ba5345..3037c5e 100644 --- a/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java +++ b/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java @@ -4,6 +4,7 @@ import java.util.List; public class Config { private String donpayToken = ""; + private int reqPerSec = 15; private int lastDonate = 0; private List actions = List.of(new Action()); @@ -31,4 +32,12 @@ public class Config { public void setActions(List actions) { this.actions = actions; } + + public int getReqPerSec() { + return reqPerSec; + } + + public void setReqPerSec(int reqPerSec) { + this.reqPerSec = reqPerSec; + } }