Skip to content

Commit

Permalink
feat: Add a checker to avoid loading the plugin if the 'force-key-aut…
Browse files Browse the repository at this point in the history
…hentication' option is set to true in Velocity
  • Loading branch information
MemencioPerez committed May 13, 2024
1 parent 708ebd2 commit f2d9f92
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.proxy.VelocityServer;
import io.github._4drian3d.unsignedvelocity.configuration.Configuration;
import io.github._4drian3d.unsignedvelocity.listener.LoadableEventListener;
import io.github._4drian3d.unsignedvelocity.listener.packet.chat.ChatListener;
Expand Down Expand Up @@ -55,6 +56,14 @@ public UnSignedVelocity(ProxyServer server, Injector injector, @DataDirectory Pa

@Subscribe
public void onProxyInitialize(ProxyInitializeEvent event) {
boolean forceKeyAuthentication = ((VelocityServer) server).getConfiguration().isForceKeyAuthentication();
if (forceKeyAuthentication) {
logger.error("ERROR: The 'force-key-authentication' option in the Velocity configuration file (velocity.toml) is set to 'true'.");
logger.error("UnSignedVelocity requires that option to be set to 'false', so the plugin will not load.");
logger.error("If you want to use UnSignedVelocity, set 'force-key-authentication' to 'false' in Velocity settings and restart the proxy.");
return;
}

factory.make(this, 17514);

try {
Expand Down

0 comments on commit f2d9f92

Please sign in to comment.