misc: rename AuthMeUtils

This commit is contained in:
Adrian 2023-02-07 17:44:09 -05:00
parent d53d035808
commit 5ef6f99236
No known key found for this signature in database
GPG Key ID: FB8EF84DCE1BE452
4 changed files with 8 additions and 8 deletions

View File

@ -29,7 +29,7 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin; import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin;
import io.github._4drian3d.authmevelocity.velocity.utils.AuthmeUtils; import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.util.Optional; import java.util.Optional;
@ -67,7 +67,7 @@ public final class ConnectListener {
return; return;
} }
final var config = plugin.config().get(); final var config = plugin.config().get();
final var server = AuthmeUtils.serverToSend( final var server = AuthMeUtils.serverToSend(
config.ensureAuthServer().sendMode(), proxy, config.authServers(), config.advanced().randomAttempts()); config.ensureAuthServer().sendMode(), proxy, config.authServers(), config.advanced().randomAttempts());
// Velocity takes over in case the initial server is not present // Velocity takes over in case the initial server is not present

View File

@ -28,7 +28,7 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
import io.github._4drian3d.authmevelocity.api.velocity.event.*; import io.github._4drian3d.authmevelocity.api.velocity.event.*;
import io.github._4drian3d.authmevelocity.common.MessageType; import io.github._4drian3d.authmevelocity.common.MessageType;
import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin; import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin;
import io.github._4drian3d.authmevelocity.velocity.utils.AuthmeUtils; import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -114,7 +114,7 @@ public class PluginMessageListener {
final var config = plugin.config().get(); final var config = plugin.config().get();
final var toSend = AuthmeUtils.serverToSend( final var toSend = AuthMeUtils.serverToSend(
config.sendOnLogin().sendMode(), proxy, config.sendOnLogin().teleportServers(), config.advanced().randomAttempts()); config.sendOnLogin().sendMode(), proxy, config.sendOnLogin().teleportServers(), config.advanced().randomAttempts());
if (toSend.isEmpty()) { if (toSend.isEmpty()) {

View File

@ -28,7 +28,7 @@ import com.velocitypowered.api.event.player.TabCompleteEvent;
import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin; import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin;
import io.github._4drian3d.authmevelocity.velocity.utils.AuthmeUtils; import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
public final class ProxyListener { public final class ProxyListener {
@ -69,7 +69,7 @@ public final class ProxyListener {
if (plugin.isInAuthServer(player)) { if (plugin.isInAuthServer(player)) {
plugin.logDebug("CommandExecuteEvent | Player is in Auth Server"); plugin.logDebug("CommandExecuteEvent | Player is in Auth Server");
String command = AuthmeUtils.getFirstArgument(event.getCommand()); String command = AuthMeUtils.getFirstArgument(event.getCommand());
if (!plugin.config().get().commands().allowedCommands().contains(command)) { if (!plugin.config().get().commands().allowedCommands().contains(command)) {
plugin.logDebug("CommandExecuteEvent | Player executed an blocked command"); plugin.logDebug("CommandExecuteEvent | Player executed an blocked command");
sendBlockedMessage(player); sendBlockedMessage(player);

View File

@ -27,7 +27,7 @@ import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.Random; import java.util.Random;
public class AuthmeUtils { public class AuthMeUtils {
//Origin: https://github.com/4drian3d/ChatRegulator/blob/main/src/main/java/me/dreamerzero/chatregulator/utils/CommandUtils.java#L71 //Origin: https://github.com/4drian3d/ChatRegulator/blob/main/src/main/java/me/dreamerzero/chatregulator/utils/CommandUtils.java#L71
/** /**
* Get the first argument of a string * Get the first argument of a string
@ -92,5 +92,5 @@ public class AuthmeUtils {
} }
}; };
} }
private AuthmeUtils() {} private AuthMeUtils() {}
} }