1
0
mirror of https://github.com/CitizensDev/Citizens2.git synced 2025-01-11 10:57:47 +01:00

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
v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util
v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util
v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util

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();