Support non-yggdrasil implementations of MinecraftSessionService

This commit is contained in:
fullwall 2018-01-29 16:26:26 +08:00
parent f33804609e
commit c767b6fdc3
3 changed files with 9 additions and 1 deletions

View File

@ -262,6 +262,9 @@ public class NMSImpl implements NMSBridge {
MinecraftSessionService sessionService = ((CraftServer) Bukkit.getServer()).getServer().ay();
if (!(sessionService instanceof YggdrasilMinecraftSessionService)) {
return sessionService.fillProfileProperties(profile, requireSecure);
}
YggdrasilAuthenticationService auth = ((YggdrasilMinecraftSessionService) sessionService)
.getAuthenticationService();

View File

@ -284,6 +284,9 @@ public class NMSImpl implements NMSBridge {
MinecraftSessionService sessionService = ((CraftServer) Bukkit.getServer()).getServer().az();
if (!(sessionService instanceof YggdrasilMinecraftSessionService)) {
return sessionService.fillProfileProperties(profile, requireSecure);
}
YggdrasilAuthenticationService auth = ((YggdrasilMinecraftSessionService) sessionService)
.getAuthenticationService();

View File

@ -288,7 +288,9 @@ public class NMSImpl implements NMSBridge {
throw new IllegalStateException("NMS.fillProfileProperties cannot be invoked from the main thread.");
MinecraftSessionService sessionService = ((CraftServer) Bukkit.getServer()).getServer().az();
if (!(sessionService instanceof YggdrasilMinecraftSessionService)) {
return sessionService.fillProfileProperties(profile, requireSecure);
}
YggdrasilAuthenticationService auth = ((YggdrasilMinecraftSessionService) sessionService)
.getAuthenticationService();