Merge pull request #256 from Gabik21/previous-server-in-event

Add previous server to ServerConnectedEvent
This commit is contained in:
Andrew Steinborn
2019-10-31 19:51:32 -04:00
committed by GitHub
2 changed files with 24 additions and 2 deletions

View File

@@ -80,7 +80,8 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
// The goods are in hand! We got JoinGame. Let's transition completely to the new state.
smc.setAutoReading(false);
server.getEventManager()
.fire(new ServerConnectedEvent(serverConn.getPlayer(), serverConn.getServer()))
.fire(new ServerConnectedEvent(serverConn.getPlayer(), serverConn.getServer(),
existingConnection != null ? existingConnection.getServer() : null))
.whenCompleteAsync((x, error) -> {
// Strap on the ClientPlaySessionHandler if required.
ClientPlaySessionHandler playHandler;