Create stub GeyserService

The FloodgateService and GeyserService classes are not merged,
because Geyser can work without Floodgate.
Added Geyser as 'softdepends' in plugin.yml and bungee.yml
to make it load before FastLogin.
Also made Floodgate a soft dependency in bungee.yml.
This commit is contained in:
Smart123s
2021-11-28 13:44:56 +01:00
committed by games647
parent 5612ca744b
commit 3ee6cb2ada
10 changed files with 136 additions and 0 deletions
@@ -36,6 +36,7 @@ import com.github.games647.fastlogin.bukkit.task.DelayedAuthHook;
import com.github.games647.fastlogin.core.CommonUtil;
import com.github.games647.fastlogin.core.PremiumStatus;
import com.github.games647.fastlogin.core.hooks.FloodgateService;
import com.github.games647.fastlogin.core.hooks.GeyserService;
import com.github.games647.fastlogin.core.shared.FastLoginCore;
import com.github.games647.fastlogin.core.shared.PlatformPlugin;
@@ -53,6 +54,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.connector.GeyserConnector;
import org.geysermc.floodgate.api.FloodgateApi;
import org.slf4j.Logger;
@@ -71,6 +73,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
private final BukkitScheduler scheduler;
private FastLoginCore<Player, CommandSender, FastLoginBukkit> core;
private FloodgateService floodgateService;
private GeyserService geyserService;
private PremiumPlaceholder premiumPlaceholder;
@@ -146,6 +149,10 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
}
private boolean initializeFloodgate() {
if (getServer().getPluginManager().getPlugin("Geyser-Spigot") != null) {
geyserService = new GeyserService(GeyserConnector.getInstance(), core);
}
if (getServer().getPluginManager().getPlugin("floodgate") != null) {
floodgateService = new FloodgateService(FloodgateApi.getInstance(), core);
@@ -281,6 +288,11 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
return floodgateService;
}
@Override
public GeyserService getGeyserService() {
return geyserService;
}
/**
* Send warning messages to log if incompatible plugins are used
*/
+2
View File
@@ -20,6 +20,8 @@ softdepend:
- ProtocolLib
# Premium variable
- PlaceholderAPI
# Bedrock Player Bridge
- Geyser-Spigot
- floodgate
# Auth plugins
- AuthMe