From 18f57f24fa66eb31b16d7032501f3e7f342fe180 Mon Sep 17 00:00:00 2001 From: Mystiflow Date: Sat, 29 Oct 2016 22:28:11 +0100 Subject: [PATCH] Fix issue pointed out by Supereg; store dimension on first join too (#1979) * Only double switch if the dimension is the same. According to the protocol, a double respawn packet is only needed to be sent if from the same dimension, so by storing the last known dimension, we are able to compare and avoid the double packet. This also maintains the same behaviour for Spigot https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/ad2f806097e51fbf72f64ba97e2e4c3785326f42 * Store current dimension on first disconnect too --- proxy/src/main/java/net/md_5/bungee/ServerConnector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 0766e819..2014b0c4 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -199,6 +199,8 @@ public class ServerConnector extends PacketHandler DefinedPacket.writeString( bungee.getName() + " (" + bungee.getVersion() + ")", brand ); user.unsafe().sendPacket( new PluginMessage( "MC|Brand", DefinedPacket.toArray( brand ), handshakeHandler.isServerForge() ) ); brand.release(); + + user.setDimension( login.getDimension() ); } else { user.getServer().setObsolete( true );