forked from TuxCoding/FastLogin
Merge pull request #525 from Smart123s/fg2-bc
Fix Floodgate 2.0 on BungeeCord
This commit is contained in:
@ -124,6 +124,7 @@
|
||||
</dependency>
|
||||
|
||||
<!-- Bedrock player bridge -->
|
||||
<!-- Should be removed one Floodgate 2.0 gets a stable release -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>floodgate-bungee</artifactId>
|
||||
@ -131,6 +132,15 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Bedrock player bridge -->
|
||||
<!-- Version 2.0 -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc.floodgate</groupId>
|
||||
<artifactId>bungee</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Login plugin-->
|
||||
<dependency>
|
||||
<groupId>me.vik1395</groupId>
|
||||
|
@ -87,8 +87,15 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
|
||||
//events
|
||||
PluginManager pluginManager = getProxy().getPluginManager();
|
||||
boolean floodgateAvail = pluginManager.getPlugin("floodgate") != null;
|
||||
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter(), floodgateAvail);
|
||||
|
||||
//check Floodgate version
|
||||
String floodgateVersion = "0";
|
||||
Plugin floodgatePlugin = pluginManager.getPlugin("floodgate");
|
||||
if (floodgatePlugin != null) {
|
||||
floodgatePlugin.getDescription().getVersion();
|
||||
}
|
||||
|
||||
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter(), floodgateVersion);
|
||||
|
||||
pluginManager.registerListener(this, connectListener);
|
||||
pluginManager.registerListener(this, new PluginMessageListener(this));
|
||||
|
@ -98,12 +98,12 @@ public class ConnectListener implements Listener {
|
||||
private final FastLoginBungee plugin;
|
||||
private final RateLimiter rateLimiter;
|
||||
private final Property[] emptyProperties = {};
|
||||
private final boolean floodGateAvailable;
|
||||
private final String floodgateVersion;
|
||||
|
||||
public ConnectListener(FastLoginBungee plugin, RateLimiter rateLimiter, boolean floodgateAvailable) {
|
||||
public ConnectListener(FastLoginBungee plugin, RateLimiter rateLimiter, String floodgateVersion) {
|
||||
this.plugin = plugin;
|
||||
this.rateLimiter = rateLimiter;
|
||||
this.floodGateAvailable = floodgateAvailable;
|
||||
this.floodgateVersion = floodgateVersion;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -211,6 +211,12 @@ public class ConnectListener implements Listener {
|
||||
// Floodgate will set a correct UUID at the beginning of the PreLoginEvent
|
||||
// and will cancel the online mode login for those players
|
||||
// Therefore we just ignore those
|
||||
return floodGateAvailable && FloodgateAPI.isBedrockPlayer(correctedUUID);
|
||||
if (floodgateVersion.startsWith("1")) {
|
||||
return FloodgateAPI.isBedrockPlayer(correctedUUID);
|
||||
} else if (floodgateVersion.startsWith("2")) {
|
||||
return FloodgateAPI.isBedrockPlayer(correctedUUID);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user