From 51330b8cda48ffa85558a23115b196e8b24572f2 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 29 Nov 2021 22:04:02 -0500 Subject: [PATCH] Some changes for GeyserConnect --- .../main/java/org/geysermc/geyser/session/GeyserSession.java | 3 ++- .../java/org/geysermc/geyser/util/LoginEncryptionUtils.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 0940a6dd9..6116604e0 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -249,7 +249,8 @@ public class GeyserSession implements GeyserConnection, CommandSender { private Vector2i lastChunkPosition = null; private int renderDistance; - private boolean sentSpawnPacket; + // Exposed for GeyserConnect usage + protected boolean sentSpawnPacket; private boolean loggedIn; private boolean loggingIn; diff --git a/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java b/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java index 213953bdd..e677798cd 100644 --- a/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java @@ -213,6 +213,11 @@ public class LoginEncryptionUtils { } public static void buildAndShowLoginWindow(GeyserSession session) { + if (session.isLoggedIn()) { + // Can happen if a window is cancelled during dimension switch + return; + } + // Set DoDaylightCycle to false so the time doesn't accelerate while we're here session.setDaylightCycle(false);