diff --git a/proxy/build.gradle.kts b/proxy/build.gradle.kts index b3c5892f..f345f232 100644 --- a/proxy/build.gradle.kts +++ b/proxy/build.gradle.kts @@ -100,6 +100,7 @@ tasks { runShadow { workingDir = file("run").also(File::mkdirs) standardInput = System.`in` + jvmArgs("-Dvelocity.packet-decode-logging=true") } named("run") { workingDir = file("run").also(File::mkdirs) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java index a7143462..dc033f57 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java @@ -170,7 +170,11 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler { @Override public boolean handle(KnownPacksPacket packet) { callConfigurationEvent().thenRun(() -> { - player.getConnectionInFlightOrConnectedServer().ensureConnected().write(packet); + VelocityServerConnection targetServer = + player.getConnectionInFlightOrConnectedServer(); + if (targetServer != null) { + targetServer.ensureConnected().write(packet); + } }).exceptionally(ex -> { logger.error("Error forwarding known packs response to backend:", ex); return null;