Fix config order initlialization
This commit is contained in:
parent
7f92021736
commit
cedf188e61
@ -35,15 +35,16 @@ public class AuthMeVelocityPlugin {
|
|||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onProxyInitialize(ProxyInitializeEvent event) {
|
public void onProxyInitialize(ProxyInitializeEvent event) {
|
||||||
|
AuthMeConfig.loadConfig(pluginDirectory, logger);
|
||||||
|
var config = AuthMeConfig.getConfig();
|
||||||
|
|
||||||
proxy.getChannelRegistrar().register(
|
proxy.getChannelRegistrar().register(
|
||||||
MinecraftChannelIdentifier.create("authmevelocity", "main"));
|
MinecraftChannelIdentifier.create("authmevelocity", "main"));
|
||||||
proxy.getEventManager().register(this, new ProxyListener(proxy, logger));
|
proxy.getEventManager().register(this, new ProxyListener(proxy, logger, config));
|
||||||
if(proxy.getPluginManager().getPlugin("fastlogin").isPresent()){
|
proxy.getPluginManager().getPlugin("fastlogin").ifPresent(fastlogin ->
|
||||||
proxy.getEventManager().register(this, new FastLoginListener(proxy));
|
proxy.getEventManager().register(this, new FastLoginListener(proxy)));
|
||||||
}
|
|
||||||
AuthMeConfig.loadConfig(pluginDirectory, logger);
|
|
||||||
logger.info("-- AuthMeVelocity enabled --");
|
logger.info("-- AuthMeVelocity enabled --");
|
||||||
var config = AuthMeConfig.getConfig();
|
|
||||||
logger.info("AuthServers: {}", config.getAuthServers());
|
logger.info("AuthServers: {}", config.getAuthServers());
|
||||||
if(config.getToServerOptions().sendToServer()){
|
if(config.getToServerOptions().sendToServer()){
|
||||||
logger.info("LobbyServers: {}", config.getToServerOptions().getTeleportServers());
|
logger.info("LobbyServers: {}", config.getToServerOptions().getTeleportServers());
|
||||||
|
@ -31,11 +31,11 @@ public class ProxyListener {
|
|||||||
private final Random rm;
|
private final Random rm;
|
||||||
private AuthMeConfig.Config config;
|
private AuthMeConfig.Config config;
|
||||||
|
|
||||||
public ProxyListener(ProxyServer proxy, Logger logger) {
|
public ProxyListener(ProxyServer proxy, Logger logger, AuthMeConfig.Config config) {
|
||||||
this.proxy = proxy;
|
this.proxy = proxy;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.rm = new Random();
|
this.rm = new Random();
|
||||||
this.config = AuthMeConfig.getConfig();
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user