Allow server name to be specified by a system property

This commit is contained in:
Luck 2021-03-13 14:16:02 +00:00
parent 370e2aed0d
commit 53bb61f9b2
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -85,7 +85,13 @@ public final class ConfigKeys {
/**
* The name of the server
*/
public static final ConfigKey<String> SERVER = lowercaseStringKey("server", "global");
public static final ConfigKey<String> SERVER = key(c -> {
String server = c.getString("server", "global").toLowerCase();
if (server.equals("load-from-system-property")) {
server = System.getProperty("luckperms.server", "global").toLowerCase();
}
return server;
});
/**
* How many minutes to wait between syncs. A value <= 0 will disable syncing.