From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Connor Linfoot Date: Wed, 12 May 2021 08:09:19 +0100 Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java index ab21f25a3eb0575d08aeac717ba2b74160f54fa9..4e23e9ac3579dd0cedf0dfdbb231f6fae111745c 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -355,12 +355,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener // Paper end String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; // Paper start com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile); - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress server.getPluginManager().callEvent(asyncEvent); profile = asyncEvent.getPlayerProfile(); profile.complete(true); // Paper - setPlayerProfileAPI