misc: rename AuthMeUtils
This commit is contained in:
parent
d53d035808
commit
5ef6f99236
@ -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
|
||||||
|
@ -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()) {
|
||||||
|
@ -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);
|
||||||
|
@ -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() {}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user