Paper/Spigot-Server-Patches/0726-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
2021-05-12 10:57:54 +02:00

26 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Connor Linfoot <connorlinfoot@me.com>
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/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java
index c67b94840e4c967baebf6eb351df15f0e4ead4be..f54af7cabc6b4e062948dc97e577e7fe04b5add4 100644
--- a/src/main/java/net/minecraft/server/network/LoginListener.java
+++ b/src/main/java/net/minecraft/server/network/LoginListener.java
@@ -327,12 +327,13 @@ public class LoginListener implements PacketLoginInListener {
// Paper end
String playerName = i.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) networkManager.getRawAddress()).getAddress(); // Paper
java.util.UUID uniqueId = i.getId();
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
// Paper start
PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(getGameProfile());
- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile);
server.getPluginManager().callEvent(asyncEvent);
profile = asyncEvent.getPlayerProfile();
profile.complete(true);