diff --git a/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java b/src/main/java/ru/bitheaven/donpayintegplug/DonPayIntegPlug.java index 38ebcf2..96654d6 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 * ConfigHandler.load().getReqPerSec()); + }, 1, 20 * ConfigHandler.load().getReqCooldown()); 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 3037c5e..badea6d 100644 --- a/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java +++ b/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java @@ -4,7 +4,8 @@ import java.util.List; public class Config { private String donpayToken = ""; - private int reqPerSec = 15; + private int reqCooldown = 15; + private int cmdCooldown = 2; private int lastDonate = 0; private List actions = List.of(new Action()); @@ -33,11 +34,19 @@ public class Config { this.actions = actions; } - public int getReqPerSec() { - return reqPerSec; + public int getReqCooldown() { + return reqCooldown; } - public void setReqPerSec(int reqPerSec) { - this.reqPerSec = reqPerSec; + public void setReqCooldown(int reqCooldown) { + this.reqCooldown = reqCooldown; + } + + public int getCmdCooldown() { + return cmdCooldown; + } + + public void setCmdCooldown(int cmdCooldown) { + this.cmdCooldown = cmdCooldown; } }