From a5000907230273eb15e7b2bce99fc30e9f531e3c Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 3 Mar 2023 15:50:01 -0500 Subject: [PATCH] fix: removed ignore signed players option Now that my UnSignedVelocity plugin exists, this option is no longer needed --- .../authmevelocity.publishing.gradle.kts | 4 ++-- .../configuration/ProxyConfiguration.java | 14 +------------- .../velocity/listener/ProxyListener.java | 19 ------------------- 3 files changed, 3 insertions(+), 34 deletions(-) diff --git a/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts b/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts index b21fa73..e9d891c 100644 --- a/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts +++ b/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts @@ -8,7 +8,7 @@ java { withSourcesJar() withJavadocJar() } - +/* publishing { publications { create("mavenJava") { @@ -70,4 +70,4 @@ signing { sign(configurations.archives.get()) sign(publishing.publications["mavenJava"]) } - +*/ diff --git a/common/src/main/java/io/github/_4drian3d/authmevelocity/common/configuration/ProxyConfiguration.java b/common/src/main/java/io/github/_4drian3d/authmevelocity/common/configuration/ProxyConfiguration.java index 550fd3f..fed867f 100644 --- a/common/src/main/java/io/github/_4drian3d/authmevelocity/common/configuration/ProxyConfiguration.java +++ b/common/src/main/java/io/github/_4drian3d/authmevelocity/common/configuration/ProxyConfiguration.java @@ -24,6 +24,7 @@ import io.github._4drian3d.authmevelocity.common.enums.SendMode; import java.util.List; +@SuppressWarnings("FieldMayBeFinal") @ConfigSerializable public class ProxyConfiguration { @Comment("List of login/registration servers") @@ -128,18 +129,5 @@ public class ProxyConfiguration { public int randomAttempts() { return this.randomAttempts; } - - @Comment(""" - Ignore blocking of commands and chat messages to 1.19.1 clients with a valid signed key - When trying to block these executions, the proxy will kick the player out. - This option allows you to prevent the plugin from trying to block these executions, - avoiding the player to be kicked out""") - private boolean ignoreSignedPlayers = false; - public boolean ignoreSignedPlayers() { - return this.ignoreSignedPlayers; - } } - - - } diff --git a/velocity/src/main/java/io/github/_4drian3d/authmevelocity/velocity/listener/ProxyListener.java b/velocity/src/main/java/io/github/_4drian3d/authmevelocity/velocity/listener/ProxyListener.java index 293d604..37ef598 100644 --- a/velocity/src/main/java/io/github/_4drian3d/authmevelocity/velocity/listener/ProxyListener.java +++ b/velocity/src/main/java/io/github/_4drian3d/authmevelocity/velocity/listener/ProxyListener.java @@ -25,7 +25,6 @@ import com.velocitypowered.api.event.command.CommandExecuteEvent; import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.player.PlayerChatEvent; import com.velocitypowered.api.event.player.TabCompleteEvent; -import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.Player; import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin; import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils; @@ -61,12 +60,6 @@ public final class ProxyListener { return; } - if (canBeIgnored(player)) { - plugin.logDebug("CommandExecuteEvent | Ignored signed player"); - continuation.resume(); - return; - } - if (plugin.isInAuthServer(player)) { plugin.logDebug("CommandExecuteEvent | Player is in Auth Server"); String command = AuthMeUtils.getFirstArgument(event.getCommand()); @@ -93,12 +86,6 @@ public final class ProxyListener { plugin.logDebug("PlayerChatEvent | Player is not logged"); - if (canBeIgnored(event.getPlayer())) { - plugin.logDebug("PlayerChatEvent | Ignored signed player"); - continuation.resume(); - return; - } - event.setResult(PlayerChatEvent.ChatResult.denied()); continuation.resume(); } @@ -128,10 +115,4 @@ public final class ProxyListener { } } - boolean canBeIgnored(Player player) { - return player.getIdentifiedKey() != null - && player.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_19_1) >= 0 - && plugin.config().get().advanced().ignoreSignedPlayers(); - } - }