mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Merge pull request #525 from Smart123s/fg2-bc
Fix Floodgate 2.0 on BungeeCord
This commit is contained in:
@ -124,6 +124,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Bedrock player bridge -->
|
<!-- Bedrock player bridge -->
|
||||||
|
<!-- Should be removed one Floodgate 2.0 gets a stable release -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.geysermc</groupId>
|
<groupId>org.geysermc</groupId>
|
||||||
<artifactId>floodgate-bungee</artifactId>
|
<artifactId>floodgate-bungee</artifactId>
|
||||||
@ -131,6 +132,15 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</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-->
|
<!--Login plugin-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.vik1395</groupId>
|
<groupId>me.vik1395</groupId>
|
||||||
|
@ -87,8 +87,15 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
|||||||
|
|
||||||
//events
|
//events
|
||||||
PluginManager pluginManager = getProxy().getPluginManager();
|
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, connectListener);
|
||||||
pluginManager.registerListener(this, new PluginMessageListener(this));
|
pluginManager.registerListener(this, new PluginMessageListener(this));
|
||||||
|
@ -98,12 +98,12 @@ public class ConnectListener implements Listener {
|
|||||||
private final FastLoginBungee plugin;
|
private final FastLoginBungee plugin;
|
||||||
private final RateLimiter rateLimiter;
|
private final RateLimiter rateLimiter;
|
||||||
private final Property[] emptyProperties = {};
|
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.plugin = plugin;
|
||||||
this.rateLimiter = rateLimiter;
|
this.rateLimiter = rateLimiter;
|
||||||
this.floodGateAvailable = floodgateAvailable;
|
this.floodgateVersion = floodgateVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -211,6 +211,12 @@ public class ConnectListener implements Listener {
|
|||||||
// Floodgate will set a correct UUID at the beginning of the PreLoginEvent
|
// Floodgate will set a correct UUID at the beginning of the PreLoginEvent
|
||||||
// and will cancel the online mode login for those players
|
// and will cancel the online mode login for those players
|
||||||
// Therefore we just ignore those
|
// 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