add slash-server aliases
This commit is contained in:
+8
-1
@@ -14,14 +14,21 @@ public class SlashServerCommand extends BaseCommand {
|
|||||||
|
|
||||||
final QueueMain main;
|
final QueueMain main;
|
||||||
final String server;
|
final String server;
|
||||||
|
final String command;
|
||||||
public SlashServerCommand(QueueMain main, String server) {
|
public SlashServerCommand(QueueMain main, String server) {
|
||||||
this.main = main;
|
this.main = main;
|
||||||
this.server = server;
|
this.server = server;
|
||||||
|
this.command = server;
|
||||||
|
}
|
||||||
|
public SlashServerCommand(QueueMain main, String command, String server) {
|
||||||
|
this.main = main;
|
||||||
|
this.server = server;
|
||||||
|
this.command = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return server;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,10 +22,20 @@ public class SlashServerManager {
|
|||||||
serverCommands.clear();
|
serverCommands.clear();
|
||||||
|
|
||||||
List<String> slashServerServers = main.getConfig().getStringList("slash-servers");
|
List<String> slashServerServers = main.getConfig().getStringList("slash-servers");
|
||||||
for(String server : slashServerServers) {
|
for(String rawServer : slashServerServers) {
|
||||||
SlashServerCommand command = new SlashServerCommand(main, server);
|
if(rawServer.contains(":") && main.isPremium()) {
|
||||||
|
String[] parts = rawServer.split(":");
|
||||||
|
String command = parts[0];
|
||||||
|
String server = parts[1];
|
||||||
|
SlashServerCommand slashServerCommand = new SlashServerCommand(main, command, server);
|
||||||
|
serverCommands.add(slashServerCommand);
|
||||||
|
implementation.registerCommand(slashServerCommand);
|
||||||
|
} else {
|
||||||
|
SlashServerCommand command = new SlashServerCommand(main, rawServer);
|
||||||
serverCommands.add(command);
|
serverCommands.add(command);
|
||||||
implementation.registerCommand(command);
|
implementation.registerCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Dont touch this number please
|
# Dont touch this number please
|
||||||
config-version: 33
|
config-version: 34
|
||||||
|
|
||||||
|
|
||||||
# This is the main config for ajQueue.
|
# This is the main config for ajQueue.
|
||||||
@@ -274,6 +274,10 @@ enable-updater: true
|
|||||||
# For example, if survival is in this list, then if a player executes /survival
|
# For example, if survival is in this list, then if a player executes /survival
|
||||||
# then they will be put in the queue for survival
|
# then they will be put in the queue for survival
|
||||||
# This works for both servers and groups
|
# This works for both servers and groups
|
||||||
|
# If you have ajQueuePlus, you can also make aliases.
|
||||||
|
# For example, if you have a server called lobby, and you want people to be able to use /hub, you can use this:
|
||||||
|
# - "hub:lobby"
|
||||||
|
# If you have the free version, you can only put the server name, no aliases.
|
||||||
slash-servers: []
|
slash-servers: []
|
||||||
|
|
||||||
# What balancer should we use?
|
# What balancer should we use?
|
||||||
|
|||||||
Reference in New Issue
Block a user