diff --git a/pom.xml b/pom.xml
index 92a99432..27fc081c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -598,11 +598,26 @@
true
+
+ opencollab-snapshot
+ https://repo.opencollab.dev/maven-snapshots/
+
+ false
+
+
+ true
+
+
-
+
+ org.geysermc.floodgate
+ api
+ 2.2.0-SNAPSHOT
+ provided
+
ch.jalu
diff --git a/src/main/java/fr/xephi/authme/listener/PlayerListener.java b/src/main/java/fr/xephi/authme/listener/PlayerListener.java
index b8173056..778fc994 100644
--- a/src/main/java/fr/xephi/authme/listener/PlayerListener.java
+++ b/src/main/java/fr/xephi/authme/listener/PlayerListener.java
@@ -52,6 +52,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerShearEntityEvent;
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
import org.bukkit.inventory.InventoryView;
+import org.geysermc.floodgate.api.FloodgateApi;
import javax.inject.Inject;
import java.util.Locale;
@@ -93,6 +94,8 @@ public class PlayerListener implements Listener {
private PermissionsManager permissionsManager;
@Inject
private QuickCommandsProtectionManager quickCommandsProtectionManager;
+ @Inject
+ private FloodgateApi Floodgate;
// Lowest priority to apply fast protection checks
@EventHandler(priority = EventPriority.LOWEST)
@@ -112,7 +115,9 @@ public class PlayerListener implements Listener {
if (validationService.isUnrestricted(name)) {
return;
}
-
+ if (settings.getProperty(RestrictionSettings.HOOK_FLOODGATE_PLAYER) && Floodgate.isFloodgateId(event.getUniqueId())){
+ return;
+ }
// Non-blocking checks
try {
onJoinVerifier.checkIsValidName(name);
@@ -120,6 +125,7 @@ public class PlayerListener implements Listener {
event.setKickMessage(messages.retrieveSingle(name, e.getReason(), e.getArgs()));
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
}
+
}
/*
diff --git a/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java b/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java
index cc92aade..478e7051 100644
--- a/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java
+++ b/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java
@@ -125,6 +125,9 @@ public final class RestrictionSettings implements SettingsHolder {
public static final Property ALLOWED_NICKNAME_CHARACTERS =
newProperty("settings.restrictions.allowedNicknameCharacters", "[a-zA-Z0-9_]*");
+ @Comment("Allow FloodGatePlayer Join Without checkIsValidName()")
+ public static final Property HOOK_FLOODGATE_PLAYER =
+ newProperty("settings.restrictions.hookFloodGatePlayer", false);
@Comment({
"How far can unregistered players walk?",
"Set to 0 for unlimited radius"
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index cd0d90be..1e7fdeed 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -15,6 +15,7 @@ softdepend:
- Essentials
- EssentialsSpawn
- ProtocolLib
+ - floodgate
commands:
authme:
description: AuthMe op commands