Add floodgate service to Bungee

This commit is contained in:
games647 committed 2021-10-05 15:42:40 +02:00
1 parent a3bf875976
commit 28480a0f01
9 files changed
+30 -11

No files matched your search

@@ -33,6 +33,7 @@ import com.github.games647.fastlogin.bungee.listener.PluginMessageListener;
import com.github.games647.fastlogin.core.AsyncScheduler;
import com.github.games647.fastlogin.core.CommonUtil;
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
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.NamespaceKey;
@@ -59,6 +60,7 @@ import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.plugin.PluginManager;
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
import org.geysermc.floodgate.api.FloodgateApi;
import org.slf4j.Logger;
/**
@@ -70,6 +72,7 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
private FastLoginCore<ProxiedPlayer, CommandSender, FastLoginBungee> core;
private AsyncScheduler scheduler;
private FloodgateService floodgateService;
private Logger logger;
@Override
@@ -83,6 +86,10 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
return;
}
if (isPluginInstalled("Floodgate")) {
floodgateService = new FloodgateService(FloodgateApi.getInstance(), core);
}
//events
PluginManager pluginManager = getProxy().getPluginManager();
@@ -185,4 +192,9 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
public boolean isPluginInstalled(String name) {
return getProxy().getPluginManager().getPlugin(name) != null;
}
@Override
public FloodgateService getFloodgateService() {
return floodgateService;
}
}
@@ -49,7 +49,7 @@ public class AsyncPremiumCheck extends JoinManagement<ProxiedPlayer, CommandSend
public AsyncPremiumCheck(FastLoginBungee plugin, PreLoginEvent preLoginEvent, PendingConnection connection,
String username) {
super(plugin.getCore(), plugin.getCore().getAuthPluginHook());
super(plugin.getCore(), plugin.getCore().getAuthPluginHook(), plugin.getFloodgateService());
this.plugin = plugin;
this.preLoginEvent = preLoginEvent;