Option to prevent joining paused queues

This commit is contained in:
ajgeiss0702
2020-07-15 16:53:12 -07:00
parent d1dc81e94f
commit 9a2fbb4762
3 changed files with 11 additions and 0 deletions
+1
View File
@@ -68,6 +68,7 @@ public class Main extends Plugin implements Listener {
d.put("errors.already-queued", "&cYou are already queued for that server!"); d.put("errors.already-queued", "&cYou are already queued for that server!");
d.put("errors.player-only", "&cThis command can only be executed as a player!"); d.put("errors.player-only", "&cThis command can only be executed as a player!");
d.put("errors.already-connected", "&cYou are already connected to this server!"); d.put("errors.already-connected", "&cYou are already connected to this server!");
d.put("errors.cant-join-paused", "&cYou cannot join the queue for {SERVER} because it is paused.");
d.put("commands.leave-queue", "&aYou left the queue for {SERVER}!"); d.put("commands.leave-queue", "&aYou left the queue for {SERVER}!");
d.put("commands.reload", "&aConfig and messages reloaded successfully!"); d.put("commands.reload", "&aConfig and messages reloaded successfully!");
@@ -442,6 +442,11 @@ public class Manager {
return; return;
} }
if(server.isPaused() && pl.config.getBoolean("prevent-joining-paused")) {
p.sendMessage(msgs.getBC("errors.cant-join-paused", "SERVER:"+server.getName()));
return;
}
if(p.getServer().getInfo().getName().equals(s)) { if(p.getServer().getInfo().getName().equals(s)) {
p.sendMessage(msgs.getBC("errors.already-connected")); p.sendMessage(msgs.getBC("errors.already-connected"));
return; return;
+5
View File
@@ -95,3 +95,8 @@ wait-after-online: 1
# When this enabled, if servers are offline then it will spam errors. You can ignore them. # When this enabled, if servers are offline then it will spam errors. You can ignore them.
# Default: false # Default: false
pinger-debug: false pinger-debug: false
# When a queue is paused, should we prevent players from joining it?
# Default: false
prevent-joining-paused: false