diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java index 6d106b35..b3beb310 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java @@ -53,6 +53,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; +import org.geysermc.floodgate.api.FloodgateApi; import org.slf4j.Logger; /** @@ -146,7 +147,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin core; private AsyncScheduler scheduler; + private FloodgateService floodgateService; private Logger logger; @Override @@ -83,6 +86,10 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin core; - public FloodgateService(FastLoginCore core) { + public FloodgateService(FloodgateApi floodgate, FastLoginCore core) { + this.floodgate = floodgate; this.core = core; } @@ -84,10 +86,11 @@ public class FloodgateService { * @param username the name of the player * @param source an instance of LoginSource */ - public void checkFloodgateNameConflict(String username, LoginSource source, FloodgatePlayer floodgatePlayer) { + public void checkNameConflict(String username, LoginSource source) { String allowConflict = core.getConfig().get("allowFloodgateNameConflict").toString().toLowerCase(); // check if the Bedrock player is linked to a Java account + FloodgatePlayer floodgatePlayer = getFloodgatePlayer(username); boolean isLinked = floodgatePlayer.getLinkedPlayer() != null; if ("false".equals(allowConflict) @@ -151,6 +154,5 @@ public class FloodgateService { public boolean isFloodgateConnection(String username) { return getFloodgatePlayer(username) != null; - } } diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java index 25a0dc44..1df6ef71 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java @@ -36,8 +36,6 @@ import java.util.Optional; import net.md_5.bungee.config.Configuration; -import org.geysermc.floodgate.api.player.FloodgatePlayer; - public abstract class JoinManagement

{ protected final FastLoginCore core; @@ -60,7 +58,7 @@ public abstract class JoinManagement

{ //check if the player is connecting through Floodgate if (floodgateService != null) { if (floodgateService.isFloodgateConnection(username)) { - floodgateService.checkFloodgateNameConflict(username, source, floodgatePlayer); + floodgateService.checkNameConflict(username, source); // skip flow for any floodgate player return; } diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java index 9de54b5a..68edf7a0 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/FastLoginVelocity.java @@ -26,6 +26,7 @@ package com.github.games647.fastlogin.velocity; import com.github.games647.fastlogin.core.AsyncScheduler; +import com.github.games647.fastlogin.core.hooks.FloodgateService; import com.github.games647.fastlogin.core.message.ChangePremiumMessage; import com.github.games647.fastlogin.core.message.ChannelMessage; import com.github.games647.fastlogin.core.message.SuccessMessage; @@ -138,6 +139,11 @@ public class FastLoginVelocity implements PlatformPlugin { return server.getPluginManager().isLoaded(name); } + @Override + public FloodgateService getFloodgateService() { + return null; + } + public FastLoginCore getCore() { return core; } diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/AsyncPremiumCheck.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/AsyncPremiumCheck.java index cb342da4..d219ef46 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/AsyncPremiumCheck.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/task/AsyncPremiumCheck.java @@ -50,7 +50,7 @@ public class AsyncPremiumCheck extends JoinManagement