diff --git a/.gitignore b/.gitignore
index 7dfc5e9..c9507cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,9 @@
-
+
+.gradle/
+/.idea/
+build/
+bin/
+
target/
pom.xml.tag
pom.xml.releaseBackup
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..6c4b5fd
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,38 @@
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+
+plugins {
+ java
+ id("com.github.johnrengelman.shadow") version "7.1.2"
+}
+
+allprojects {
+ apply(plugin = "java")
+ repositories {
+ mavenCentral()
+ maven("https://repo.papermc.io/repository/maven-public/")
+ }
+}
+
+dependencies {
+ shadow(project(":authmevelocity-common"))
+ shadow(project(":authmevelocity-velocity"))
+ shadow(project(":authmevelocity-paper"))
+}
+
+tasks {
+ shadowJar {
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+ archiveFileName.set("AuthMeVelocity.jar")
+ configurations = listOf(project.configurations.shadow.get())
+ }
+
+ build {
+ dependsOn(shadowJar)
+ }
+
+ compileJava {
+ options.encoding = Charsets.UTF_8.name()
+
+ options.release.set(17)
+ }
+}
\ No newline at end of file
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/MessageType.java b/common/src/main/java/me/adrianed/authmevelocity/common/MessageType.java
similarity index 67%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/MessageType.java
rename to common/src/main/java/me/adrianed/authmevelocity/common/MessageType.java
index 52c054d..ffcec61 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/MessageType.java
+++ b/common/src/main/java/me/adrianed/authmevelocity/common/MessageType.java
@@ -1,4 +1,4 @@
-package com.glyart.authmevelocity.spigot;
+package me.adrianed.authmevelocity.common;
public enum MessageType {
LOGIN, REGISTER, LOGOUT, FORCE_UNREGISTER, UNREGISTER;
diff --git a/common/src/main/java/me/adrianed/authmevelocity/common/configuration/Loader.java b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/Loader.java
new file mode 100644
index 0000000..3d4161b
--- /dev/null
+++ b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/Loader.java
@@ -0,0 +1,5 @@
+package me.adrianed.authmevelocity.common.configuration;
+
+public class Loader {
+
+}
diff --git a/common/src/main/java/me/adrianed/authmevelocity/common/configuration/PaperConfiguration.java b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/PaperConfiguration.java
new file mode 100644
index 0000000..94e32b3
--- /dev/null
+++ b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/PaperConfiguration.java
@@ -0,0 +1,5 @@
+package me.adrianed.authmevelocity.common.configuration;
+
+public class PaperConfiguration {
+
+}
diff --git a/common/src/main/java/me/adrianed/authmevelocity/common/configuration/ProxyConfiguration.java b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/ProxyConfiguration.java
new file mode 100644
index 0000000..7c2390f
--- /dev/null
+++ b/common/src/main/java/me/adrianed/authmevelocity/common/configuration/ProxyConfiguration.java
@@ -0,0 +1,5 @@
+package me.adrianed.authmevelocity.common.configuration;
+
+public class ProxyConfiguration {
+
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..8b4950a
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,9 @@
+group = me.adrianed.authmevelocity
+version = 3.0.0-SNAPSHOT
+description = A global chat regulator for you Velocity network
+url = https://forums.velocitypowered.com/t/chatregulator-a-global-chat-regulator-for-velocity/962
+id = chatregulator
+
+caffeine-version = 3.1.1
+configurate-version = 4.1.2
+geantyref-version = 1.3.13
\ No newline at end of file
diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts
new file mode 100644
index 0000000..fa90cc6
--- /dev/null
+++ b/paper/build.gradle.kts
@@ -0,0 +1,50 @@
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+
+plugins {
+ id("net.minecrell.plugin-yml.bukkit") version "0.5.2"
+ id("com.github.johnrengelman.shadow") version "7.1.2"
+}
+
+repositories {
+ maven("https://jitpack.io")
+ maven("https://repo.codemc.org/repository/maven-public/")
+ maven("https://repo.alessiodp.com/releases/")
+}
+
+dependencies {
+ compileOnly("io.papermc.paper:paper-api:1.19.1-R0.1-SNAPSHOT")
+ compileOnly("fr.xephi:authme:5.6.0-SNAPSHOT")
+ compileOnly("com.github.4drian3d:MiniPlaceholders:1.1.1")
+ shadow("net.byteflux:libby-bukkit:1.1.5")
+ compileOnly(project(":authmevelocity-common"))
+}
+
+bukkit {
+ name = "AuthMeVelocity"
+ main = "me.adrianed.authmevelocity.paper.AuthMeVelocityPaper"
+ apiVersion = "1.13"
+ website = "https://github.com/4drian3d/AuthMeVelocity"
+ authors = listOf("xQuickGlare", "4drian3d")
+ softDepend = listOf("MiniPlaceholders")
+ depend = listOf("AuthMe")
+ version = "4.0.0"
+}
+tasks {
+ shadowJar {
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+ relocate("net.byteflux.libby", "me.adrianed.authmevelocity.libs.libby")
+ configurations = listOf(project.configurations.shadow.get())
+ }
+
+ build {
+ dependsOn(shadowJar)
+ }
+
+ compileJava {
+ options.encoding = Charsets.UTF_8.name()
+
+ options.release.set(17)
+ }
+}
+
+java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthMeVelocityPlugin.java b/paper/src/main/java/me/adrianed/authmevelocity/paper/AuthMeVelocityPlugin.java
similarity index 88%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthMeVelocityPlugin.java
rename to paper/src/main/java/me/adrianed/authmevelocity/paper/AuthMeVelocityPlugin.java
index 10e1f7a..b52df81 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthMeVelocityPlugin.java
+++ b/paper/src/main/java/me/adrianed/authmevelocity/paper/AuthMeVelocityPlugin.java
@@ -1,7 +1,8 @@
-package com.glyart.authmevelocity.spigot;
+package me.adrianed.authmevelocity.paper;
-import com.glyart.authmevelocity.spigot.listeners.AuthMeListener;
-import com.glyart.authmevelocity.spigot.listeners.MessageListener;
+import me.adrianed.authmevelocity.paper.listeners.AuthMeListener;
+import me.adrianed.authmevelocity.paper.listeners.MessageListener;
+import me.adrianed.authmevelocity.common.MessageType;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthmePlaceholders.java b/paper/src/main/java/me/adrianed/authmevelocity/paper/AuthmePlaceholders.java
similarity index 96%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthmePlaceholders.java
rename to paper/src/main/java/me/adrianed/authmevelocity/paper/AuthmePlaceholders.java
index 50761b4..bb7ebdd 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/AuthmePlaceholders.java
+++ b/paper/src/main/java/me/adrianed/authmevelocity/paper/AuthmePlaceholders.java
@@ -1,4 +1,4 @@
-package com.glyart.authmevelocity.spigot;
+package me.adrianed.authmevelocity.paper;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/events/PreSendLoginEvent.java b/paper/src/main/java/me/adrianed/authmevelocity/paper/events/PreSendLoginEvent.java
similarity index 94%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/events/PreSendLoginEvent.java
rename to paper/src/main/java/me/adrianed/authmevelocity/paper/events/PreSendLoginEvent.java
index 1ea44c8..6472b87 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/events/PreSendLoginEvent.java
+++ b/paper/src/main/java/me/adrianed/authmevelocity/paper/events/PreSendLoginEvent.java
@@ -1,4 +1,4 @@
-package com.glyart.authmevelocity.spigot.events;
+package me.adrianed.authmevelocity.paper.events;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/AuthMeListener.java b/paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/AuthMeListener.java
similarity index 87%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/AuthMeListener.java
rename to paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/AuthMeListener.java
index 4e579c1..d2856a5 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/AuthMeListener.java
+++ b/paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/AuthMeListener.java
@@ -1,8 +1,8 @@
-package com.glyart.authmevelocity.spigot.listeners;
+package me.adrianed.authmevelocity.paper.listeners;
-import com.glyart.authmevelocity.spigot.AuthMeVelocityPlugin;
-import com.glyart.authmevelocity.spigot.MessageType;
-import com.glyart.authmevelocity.spigot.events.PreSendLoginEvent;
+import me.adrianed.authmevelocity.paper.AuthMeVelocityPlugin;
+import me.adrianed.authmevelocity.common.MessageType;
+import me.adrianed.authmevelocity.paper.events.PreSendLoginEvent;
import fr.xephi.authme.events.LoginEvent;
import fr.xephi.authme.events.LogoutEvent;
diff --git a/spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/MessageListener.java b/paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/MessageListener.java
similarity index 94%
rename from spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/MessageListener.java
rename to paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/MessageListener.java
index c2629ff..f713562 100644
--- a/spigot/src/main/java/com/glyart/authmevelocity/spigot/listeners/MessageListener.java
+++ b/paper/src/main/java/me/adrianed/authmevelocity/paper/listeners/MessageListener.java
@@ -1,4 +1,4 @@
-package com.glyart.authmevelocity.spigot.listeners;
+package me.adrianed.authmevelocity.paper.listeners;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 86528c6..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
- 4.0.0
-
- com.glyart.authmevelocity
- parent
- pom
- 2.2.2
-
-
- 11
- 11
-
-
-
-
- apache.snapshots
- https://repository.apache.org/snapshots/
-
-
-
-
- spigot
- proxy
-
-
-
- AuthMeVelocity-${project.name}
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.10.1
-
- 11
- 11
-
-
-
-
-
- src/main/resources
- true
-
-
-
-
diff --git a/proxy/pom.xml b/proxy/pom.xml
deleted file mode 100644
index 72f6851..0000000
--- a/proxy/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- parent
- com.glyart.authmevelocity
- 2.2.2
-
- 4.0.0
-
-
- 11
- 11
-
-
- proxy
-
-
-
- papermc
- https://repo.papermc.io/repository/maven-public/
-
-
- codemc-snapshots
- https://repo.codemc.io/repository/maven-snapshots/
-
-
- jitpack.io
- https://jitpack.io
-
-
-
-
-
- com.velocitypowered
- velocity-api
- 3.1.2-SNAPSHOT
- provided
-
-
- com.github.games647
- fastlogin.velocity
- 1.11-SNAPSHOT
- provided
-
-
- com.github.4drian3d
- MiniPlaceholders
- 1.1.1
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.2.2
-
-
-
-
diff --git a/proxy/src/main/resources/velocity-plugin.json b/proxy/src/main/resources/velocity-plugin.json
deleted file mode 100644
index 0743eea..0000000
--- a/proxy/src/main/resources/velocity-plugin.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "id":"authmevelocity",
- "name":"AuthMeVelocity",
- "version":"${project.version}",
- "url":"https://github.com/4drian3d/AuthMeVelocity",
- "description":"This plugin adds the support for AuthMeReloaded to Velocity.",
- "authors":["xQuickGlare", "4drian3d"],
- "dependencies":[
- {
- "id":"fastlogin",
- "optional":true
- },
- {
- "id":"miniplaceholders",
- "optional":true
- }
- ],
- "main":"com.glyart.authmevelocity.proxy.AuthMeVelocityPlugin"
-}
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..ca8070f
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,6 @@
+rootProject.name = "authmevelocity-parent"
+
+listOf("common", "paper", "velocity").forEach {
+ include("authmevelocity-$it")
+ project(":authmevelocity-$it").projectDir = file(it)
+}
\ No newline at end of file
diff --git a/spigot/pom.xml b/spigot/pom.xml
deleted file mode 100644
index 76fb522..0000000
--- a/spigot/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
- parent
- com.glyart.authmevelocity
- 2.2.2
-
- 4.0.0
-
- spigot
-
-
- 11
- 11
-
-
-
-
- papermc
- https://repo.papermc.io/repository/maven-public/
-
-
-
- codemc-repo
- https://repo.codemc.org/repository/maven-public/
-
-
-
- jitpack.io
- https://jitpack.io
-
-
-
-
-
- io.papermc.paper
- paper-api
- 1.18.2-R0.1-SNAPSHOT
- provided
-
-
- fr.xephi
- authme
- 5.6.0-SNAPSHOT
- provided
-
-
-
- com.github.4drian3d
- MiniPlaceholders
- 1.1.1
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.2.2
-
-
-
-
diff --git a/spigot/src/main/resources/plugin.yml b/spigot/src/main/resources/plugin.yml
deleted file mode 100644
index ad850ab..0000000
--- a/spigot/src/main/resources/plugin.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-name: AuthMeVelocity
-authors: [xQuickGlare, 4drian3d]
-version: ${project.version}
-main: com.glyart.authmevelocity.spigot.AuthMeVelocityPlugin
-depend: [AuthMe]
-soft-depend: [MiniPlaceholders]
-# pls, dont use outdated versions, use 1.16.5+
-api-version: 1.13
\ No newline at end of file
diff --git a/velocity/build.gradle.kts b/velocity/build.gradle.kts
new file mode 100644
index 0000000..a900d80
--- /dev/null
+++ b/velocity/build.gradle.kts
@@ -0,0 +1,26 @@
+plugins {
+ id("com.github.johnrengelman.shadow") version "7.1.2"
+}
+
+repositories {
+ maven("https://jitpack.io")
+ maven("https://repo.codemc.org/repository/maven-public/")
+ maven("https://repo.alessiodp.com/releases/")
+}
+
+dependencies {
+ compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
+ annotationProcessor("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
+ compileOnly("com.github.4drian3d:MiniPlaceholders:1.1.1")
+ compileOnly("com.github.games647:fastlogin.velocity:1.11-SNAPSHOT")
+ shadow("net.byteflux:libby-velocity:1.1.5")
+ compileOnly(project(":authmevelocity-common"))
+}
+
+tasks.compileJava {
+ options.encoding = Charsets.UTF_8.name()
+
+ options.release.set(17)
+}
+
+java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmePlaceholders.java b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMePlaceholders.java
similarity index 74%
rename from proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmePlaceholders.java
rename to velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMePlaceholders.java
index 47d63fa..02e66de 100644
--- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmePlaceholders.java
+++ b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMePlaceholders.java
@@ -1,4 +1,4 @@
-package com.glyart.authmevelocity.proxy;
+package me.adrianed.authmevelocity.velocity;
import com.velocitypowered.api.proxy.Player;
@@ -7,31 +7,31 @@ import net.kyori.adventure.text.minimessage.tag.Tag;
import static me.dreamerzero.miniplaceholders.api.utils.Components.*;
-final class AuthmePlaceholders {
- private AuthmePlaceholders(){}
+final class AuthMePlaceholders {
+ private AuthMePlaceholders() {}
static Expansion getExpansion(AuthMeVelocityPlugin plugin){
return Expansion.builder("authme")
.filter(Player.class)
// Logged Placeholders
.audiencePlaceholder("is_logged", (aud, queue, ctx) ->
- Tag.selfClosingInserting(plugin.getAPI().isLogged((Player)aud) ? TRUE_COMPONENT : FALSE_COMPONENT))
+ Tag.selfClosingInserting(plugin.isLogged((Player)aud) ? TRUE_COMPONENT : FALSE_COMPONENT))
.globalPlaceholder("is_player_logged", (queue, ctx) -> {
String playerName = queue.popOr(() -> "you need to provide a player").value();
return Tag.selfClosingInserting(
plugin.getProxy().getPlayer(playerName)
- .map(plugin.getAPI()::isLogged)
+ .map(plugin::isLogged)
.orElse(false) ? TRUE_COMPONENT : FALSE_COMPONENT
);
})
// In Auth Server placeholders
.audiencePlaceholder("in_auth_server", (aud, queue, ctx) ->
- Tag.selfClosingInserting(plugin.getAPI().isInAuthServer((Player)aud) ? TRUE_COMPONENT : FALSE_COMPONENT))
+ Tag.selfClosingInserting(plugin.isInAuthServer((Player)aud) ? TRUE_COMPONENT : FALSE_COMPONENT))
.globalPlaceholder("player_in_auth_server", (queue, ctx) -> {
String playerName = queue.popOr(() -> "you need to provide a player").value();
return Tag.selfClosingInserting(
plugin.getProxy().getPlayer(playerName)
- .map(plugin.getAPI()::isInAuthServer)
+ .map(plugin::isInAuthServer)
.orElse(false) ? TRUE_COMPONENT : FALSE_COMPONENT
);
})
diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityAPI.java
similarity index 50%
rename from proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java
rename to velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityAPI.java
index 6e8f869..2de20d8 100644
--- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthmeVelocityAPI.java
+++ b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityAPI.java
@@ -1,8 +1,8 @@
-package com.glyart.authmevelocity.proxy;
+package me.adrianed.authmevelocity.velocity;
import java.util.function.Predicate;
-import com.glyart.authmevelocity.proxy.config.AuthMeConfig;
+import me.adrianed.authmevelocity.velocity.config.AuthMeConfig;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.RegisteredServer;
@@ -12,91 +12,67 @@ import org.jetbrains.annotations.NotNull;
/**
* API provided to interact with logged players
*/
-public final class AuthmeVelocityAPI {
- private final AuthMeVelocityPlugin plugin;
- private final AuthMeConfig config;
- AuthmeVelocityAPI(AuthMeVelocityPlugin plugin, AuthMeConfig config){
- this.plugin = plugin;
- this.config = config;
- }
+public sealed interface AuthMeVelocityAPI permits AuthMeVelocityPlugin {
/**
* Check if the player is logged in or not
* @param player the player
* @return if the player is logged in or not
*/
- public boolean isLogged(@NotNull Player player){
- return plugin.loggedPlayers.contains(player.getUniqueId());
- }
+ boolean isLogged(@NotNull Player player);
/**
* Check if the player is not logged
* @param player the player
* @return if the player is not logged
*/
- public boolean isNotLogged(@NotNull Player player){
- return !plugin.loggedPlayers.contains(player.getUniqueId());
- }
+ boolean isNotLogged(@NotNull Player player);
/**
* Adds a player to the list of logged in players
* @param player the new logged player
* @return if the player was succesfully added
*/
- public boolean addPlayer(@NotNull Player player){
- return plugin.loggedPlayers.add(player.getUniqueId());
- }
+ boolean addPlayer(@NotNull Player player);
/**
* Removes a player from the list of logged-in players
* @param player the unlogged player
* @return if the player was succesfully removed
*/
- public boolean removePlayer(@NotNull Player player){
- return plugin.loggedPlayers.remove(player.getUniqueId());
- }
+ boolean removePlayer(@NotNull Player player);
/**
* Removes players who meet the established condition
* @param predicate the condition
*/
- public void removePlayerIf(@NotNull Predicate predicate){
- plugin.loggedPlayers.removeIf(uuid -> predicate.test(plugin.getProxy().getPlayer(uuid).orElse(null)));
- }
+ void removePlayerIf(@NotNull Predicate predicate);
/**
* Check if the player is on a login server
* @param player the player
* @return if the player is on a login server
*/
- public boolean isInAuthServer(@NotNull Player player){
- return player.getCurrentServer().map(this::isAuthServer).orElse(false);
- }
+ boolean isInAuthServer(@NotNull Player player);
/**
* Check if a server is intended to be a logging server
* @param server the server
* @return if the server is a login server
*/
- public boolean isAuthServer(@NotNull RegisteredServer server){
- return config.getAuthServers().contains(server.getServerInfo().getName());
- }
+ boolean isAuthServer(@NotNull RegisteredServer server);
/**
* Checks if a connection is made from a login server
* @param connection the connection
* @return if the connection is made from a login server
*/
- public boolean isAuthServer(@NotNull ServerConnection connection){
- return config.getAuthServers().contains(connection.getServerInfo().getName());
- }
+ boolean isAuthServer(@NotNull ServerConnection connection);
/**
* Checks if a string is an name of an auth server
* @param server the server name
* @return if the server is an auth serverr
*/
- public boolean isAuthServer(@NotNull String server){
- return config.getAuthServers().contains(server);
- }
+ boolean isAuthServer(@NotNull String server);
}
diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityPlugin.java
similarity index 59%
rename from proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java
rename to velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityPlugin.java
index 9ab15b2..bfcd35c 100644
--- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java
+++ b/velocity/src/main/java/me/adrianed/authmevelocity/velocity/AuthMeVelocityPlugin.java
@@ -1,18 +1,23 @@
-package com.glyart.authmevelocity.proxy;
+package me.adrianed.authmevelocity.velocity;
-import com.glyart.authmevelocity.proxy.commands.AuthmeCommand;
-import com.glyart.authmevelocity.proxy.config.AuthMeConfig;
-import com.glyart.authmevelocity.proxy.listener.ConnectListener;
-import com.glyart.authmevelocity.proxy.listener.FastLoginListener;
-import com.glyart.authmevelocity.proxy.listener.PluginMessageListener;
-import com.glyart.authmevelocity.proxy.listener.ProxyListener;
+import me.adrianed.authmevelocity.velocity.commands.AuthmeCommand;
+import me.adrianed.authmevelocity.velocity.config.AuthMeConfig;
+import me.adrianed.authmevelocity.velocity.listener.ConnectListener;
+import me.adrianed.authmevelocity.velocity.listener.FastLoginListener;
+import me.adrianed.authmevelocity.velocity.listener.PluginMessageListener;
+import me.adrianed.authmevelocity.velocity.listener.ProxyListener;
import com.google.inject.Inject;
import com.moandjiezana.toml.Toml;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
+import com.velocitypowered.api.plugin.Plugin;
+import com.velocitypowered.api.plugin.Dependency;
import com.velocitypowered.api.proxy.ProxyServer;
+import com.velocitypowered.api.proxy.Player;
+import com.velocitypowered.api.proxy.ServerConnection;
+import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
@@ -20,6 +25,7 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
import org.slf4j.Logger;
+import java.util.function.Predicate;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
@@ -32,13 +38,28 @@ import java.util.Objects;
import java.util.Set;
import java.util.UUID;
-public class AuthMeVelocityPlugin {
+@Plugin(
+ id = "authmevelocity",
+ name = "AuthMeVelocity",
+ url = "https://github.com/4drian3d/AuthMeVelocity",
+ description = "This plugin adds the support for AuthMeReloaded to Velocity",
+ dependencies = {
+ @Dependency(
+ id = "miniplaceholders",
+ optional = true
+ ),
+ @Dependency(
+ id = "fastlogin",
+ optional = true
+ )
+ }
+)
+public final class AuthMeVelocityPlugin implements AuthMeVelocityAPI {
public static final ChannelIdentifier AUTHMEVELOCITY_CHANNEL
= MinecraftChannelIdentifier.create("authmevelocity", "main");
private final ProxyServer proxy;
private final Logger logger;
private final Path pluginDirectory;
- private AuthmeVelocityAPI api;
private AuthMeConfig config;
private final List