From 7a84defae41d7a84db29613e98e2945d14b61b2d Mon Sep 17 00:00:00 2001 From: cakoyo Date: Wed, 16 Dec 2020 21:43:09 +0100 Subject: [PATCH] Emancipate more features to PlayerHandshakeEvent * The hostname and socket address was not null when the event fired, but the event does not provide the value, the change allows plugins to use the old value. * Since `proxyLogicEnabled` will be checked after the event fired, to check the config value will allow plugins to modify it during the event handling. Signed-off-by: MiniDigger | Martin --- ...Add-handshake-event-to-allow-plugins-to-handle-clien.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 1039466c1..3393c0c3c 100644 --- a/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -37,8 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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!