Fix creating logging session in ProtocolSupport environments

Fixes #251
This commit is contained in:
games647
2019-05-11 21:16:38 +02:00
parent 28743d23bf
commit 4110ce2fa2
2 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,11 @@ public class BukkitLoginSession extends LoginSession {
this(username, "", EMPTY_ARRAY, false, profile); this(username, "", EMPTY_ARRAY, false, profile);
} }
//ProtocolSupport
public BukkitLoginSession(String username, boolean registered, StoredProfile profile) {
this(username, "", EMPTY_ARRAY, registered, profile);
}
/** /**
* Gets the verify token the server sent to the client. * Gets the verify token the server sent to the client.
* *

View File

@ -73,8 +73,7 @@ public class ProtocolSupportListener extends JoinManagement<Player, CommandSende
String ip = source.getAddress().getAddress().getHostAddress(); String ip = source.getAddress().getAddress().getHostAddress();
plugin.getCore().getPendingLogin().put(ip + username, new Object()); plugin.getCore().getPendingLogin().put(ip + username, new Object());
BukkitLoginSession playerSession = new BukkitLoginSession(username, null, null BukkitLoginSession playerSession = new BukkitLoginSession(username, registered, profile);
, registered, profile);
plugin.getLoginSessions().put(source.getAddress().toString(), playerSession); plugin.getLoginSessions().put(source.getAddress().toString(), playerSession);
if (plugin.getConfig().getBoolean("premiumUuid")) { if (plugin.getConfig().getBoolean("premiumUuid")) {
source.getLoginStartEvent().setOnlineMode(true); source.getLoginStartEvent().setOnlineMode(true);