Skip to content

Commit

Permalink
fix: simply call the method to forcibly disable the force-key-authent…
Browse files Browse the repository at this point in the history
…ication option on proxy initialization
  • Loading branch information
MemencioPerez committed Jan 1, 2025
1 parent 0739780 commit 28535f6
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ public void onProxyInitialize(ProxyInitializeEvent event) {

try {
loadMainFeatures();
forciblyDisableForceKeyAuthentication();
} catch (IOException e) {
logger.error("Cannot load configuration", e);
return;
} catch (NoSuchFieldException e) {
logger.error("The plugin cannot find 'force-key-authentication' option field, 'remove-signed-key-on-join' option will not work. Contact the developer of this plugin.", e);
return;
} catch (IllegalAccessException e) {
logger.error("The plugin cannot access 'force-key-authentication' option field, 'remove-signed-key-on-join' option will not work. If setting 'force-key-authentication' to 'false' manually and restarting the proxy doesn't work, contact the developer of this plugin.", e);
return;
}

CommandManager commandManager = server.getCommandManager();
Expand All @@ -92,15 +99,6 @@ public void onProxyInitialize(ProxyInitializeEvent event) {

public void loadMainFeatures() throws IOException {
setupConfigurationModule();

try {
forciblyDisableForceKeyAuthentication();
} catch (NoSuchFieldException e) {
logger.error("The plugin cannot find 'force-key-authentication' option field, 'remove-signed-key-on-join' option will not work. Contact the developer of this plugin.", e);
} catch (IllegalAccessException e) {
logger.error("The plugin cannot access 'force-key-authentication' option field, 'remove-signed-key-on-join' option will not work. If setting 'force-key-authentication' to 'false' manually and restarting the proxy doesn't work, contact the developer of this plugin.", e);
}

setupConfigurablePacketListeners();
}

Expand Down

0 comments on commit 28535f6

Please sign in to comment.