From 28535f64ff895d0341c5b477a63b81a7454e6737 Mon Sep 17 00:00:00 2001 From: MemencioPerez Date: Wed, 1 Jan 2025 18:44:11 -0400 Subject: [PATCH] fix: simply call the method to forcibly disable the force-key-authentication option on proxy initialization --- .../unsignedvelocity/UnSignedVelocity.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/github/_4drian3d/unsignedvelocity/UnSignedVelocity.java b/src/main/java/io/github/_4drian3d/unsignedvelocity/UnSignedVelocity.java index 84cf388..26c2963 100644 --- a/src/main/java/io/github/_4drian3d/unsignedvelocity/UnSignedVelocity.java +++ b/src/main/java/io/github/_4drian3d/unsignedvelocity/UnSignedVelocity.java @@ -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(); @@ -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(); }