diff --git a/Spigot-Server-Patches/0087-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/0087-Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 42ee3f800..80676bf40 100644 --- a/Spigot-Server-Patches/0087-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-Server-Patches/0087-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 69fd0a7b230c6f6eb46a43477465f77b265cc3c9..396c3f824968512e55987fd98d82d10e9cad6903 100644 +index 69fd0a7b230c6f6eb46a43477465f77b265cc3c9..4de8646811f25b6217cffcd31fc14bcf79151b1a 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -14,7 +14,7 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -37,8 +37,8 @@ index 69fd0a7b230c6f6eb46a43477465f77b265cc3c9..396c3f824968512e55987fd98d82d10e + return; + } + -+ packethandshakinginsetprotocol.hostname = event.getServerHostname(); -+ this.getNetworkManager().socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.getNetworkManager().getSocketAddress()).getPort()); ++ if (event.getServerHostname() != null) packethandshakinginsetprotocol.hostname = event.getServerHostname(); ++ if (event.getSocketAddressHostname() != null) this.getNetworkManager().socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.getNetworkManager().getSocketAddress()).getPort()); + this.getNetworkManager().spoofedUUID = event.getUniqueId(); + this.getNetworkManager().spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); + handledByEvent = true; // Hooray, we did it!