mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Update to Geyser 2.0 API
This commit is contained in:
@ -216,7 +216,7 @@
|
||||
<!-- Bedrock player bridge -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
@ -227,6 +227,14 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- We need the API, but it was excluded above -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-api</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Provide premium placeholders-->
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
|
@ -55,8 +55,8 @@ 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.geysermc.geyser.GeyserImpl;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
@ -151,7 +151,7 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
||||
|
||||
private boolean initializeFloodgate() {
|
||||
if (getServer().getPluginManager().getPlugin("Geyser-Spigot") != null) {
|
||||
geyserService = new GeyserService(GeyserConnector.getInstance(), core);
|
||||
geyserService = new GeyserService(GeyserImpl.getInstance(), core);
|
||||
}
|
||||
|
||||
if (getServer().getPluginManager().getPlugin("floodgate") != null) {
|
||||
|
@ -152,7 +152,7 @@
|
||||
<!-- Bedrock player bridge -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
@ -163,6 +163,14 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- We need the API, but it was excluded above -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-api</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Login plugin-->
|
||||
<dependency>
|
||||
<groupId>me.vik1395</groupId>
|
||||
|
@ -62,8 +62,8 @@ 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.connector.GeyserConnector;
|
||||
import org.geysermc.floodgate.api.FloodgateApi;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
@ -95,7 +95,7 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
}
|
||||
|
||||
if (isPluginInstalled("Geyser-BungeeCord")) {
|
||||
geyserService = new GeyserService(GeyserConnector.getInstance(), core);
|
||||
geyserService = new GeyserService(GeyserImpl.getInstance(), core);
|
||||
}
|
||||
|
||||
//events
|
||||
|
10
core/pom.xml
10
core/pom.xml
@ -119,7 +119,7 @@
|
||||
<!-- Bedrock player bridge -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>connector</artifactId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
@ -130,6 +130,14 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- We need the API, but it was excluded above -->
|
||||
<dependency>
|
||||
<groupId>org.geysermc</groupId>
|
||||
<artifactId>geyser-api</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--Common component for contacting the Mojang API-->
|
||||
<dependency>
|
||||
<groupId>com.github.games647</groupId>
|
||||
|
@ -30,21 +30,21 @@ import java.util.UUID;
|
||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.common.AuthType;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.auth.AuthType;
|
||||
|
||||
public class GeyserService extends BedrockService<GeyserSession> {
|
||||
|
||||
private final GeyserConnector geyser;
|
||||
private final GeyserImpl geyser;
|
||||
private final FastLoginCore<?, ?, ?> core;
|
||||
private final AuthType authType;
|
||||
|
||||
public GeyserService(GeyserConnector geyser, FastLoginCore<?, ?, ?> core) {
|
||||
public GeyserService(GeyserImpl geyser, FastLoginCore<?, ?, ?> core) {
|
||||
super(core);
|
||||
this.geyser = geyser;
|
||||
this.core = core;
|
||||
this.authType = geyser.getConfig().getRemote().getAuthType();
|
||||
this.authType = GeyserImpl.getInstance().getConfig().getRemote().getAuthType();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,17 +65,11 @@ public class GeyserService extends BedrockService<GeyserSession> {
|
||||
|
||||
@Override
|
||||
public GeyserSession getBedrockPlayer(String username) {
|
||||
for (GeyserSession gSess : geyser.getSessionManager().getSessions().values()) {
|
||||
if (gSess.getName().equals(username)) {
|
||||
return gSess;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return geyser.connectionByName(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeyserSession getBedrockPlayer(UUID uuid) {
|
||||
return geyser.getPlayerByUuid(uuid);
|
||||
return geyser.connectionByUuid(uuid);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user