Add variable for control speed of requests

This commit is contained in:
BitHeaven 2025-01-22 10:45:55 +05:00
parent d140aa6b6c
commit c73269a37b
2 changed files with 10 additions and 1 deletions

View File

@ -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());

View File

@ -4,6 +4,7 @@ import java.util.List;
public class Config {
private String donpayToken = "<YOUR_TOKEN>";
private int reqPerSec = 15;
private int lastDonate = 0;
private List<Action> actions = List.of(new Action());
@ -31,4 +32,12 @@ public class Config {
public void setActions(List<Action> actions) {
this.actions = actions;
}
public int getReqPerSec() {
return reqPerSec;
}
public void setReqPerSec(int reqPerSec) {
this.reqPerSec = reqPerSec;
}
}