Add variable for control speed of requests
This commit is contained in:
parent
d140aa6b6c
commit
c73269a37b
@ -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());
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user