check-last-player-sent-time config option

This commit is contained in:
ajgeiss0702
2021-01-26 07:45:18 -07:00
parent af397b1673
commit 54e7eb36e6
4 changed files with 27 additions and 3 deletions
+9 -2
View File
@@ -657,8 +657,15 @@ public class Manager {
}
int pos = list.indexOf(p)+1;
int len = list.size();
boolean sendInstant = pl.config.getStringList("send-instantly").indexOf(server.getName()) != -1;
if((list.size() <= 1 || sendInstant) && server.canAccess(p)) {
boolean sendInstant = pl.config.getStringList("send-instantly").indexOf(server.getName()) != -1 && server.canAccess(p);
boolean sendInstantp = list.size() <= 1 && server.canAccess(p);
boolean timeGood = pl.config.getBoolean("check-last-player-sent-time") ?
System.currentTimeMillis() - server.getLastSentTime() > Math.floor(pl.getConfig().getDouble("wait-time")*1000)
: true;
if(sendInstant || (sendInstantp && timeGood)) {
sendPlayers(s);
BaseComponent[] m = msgs.getBC("status.now-in-empty-queue", "POS:"+pos, "LEN:"+len, "SERVER:"+pl.aliases.getAlias(s));
if(TextComponent.toPlainText(m).length() > 0) {