2021-06-11 14:02:28 +02:00
|
|
|
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/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
2021-06-15 04:59:31 +02:00
|
|
|
index 21ed58d746cb0734cc45574888ed03886e7c411a..8cc84be906fc8b50429af96c346f7114a2191535 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
2021-06-15 04:59:31 +02:00
|
|
|
@@ -346,12 +346,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();
|
2021-06-11 14:02:28 +02:00
|
|
|
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper
|
2021-06-15 04:59:31 +02:00
|
|
|
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
|
2021-06-11 14:02:28 +02:00
|
|
|
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
|
|
|
|
|
|
|
|
// Paper start
|
2021-06-15 04:59:31 +02:00
|
|
|
PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);
|
2021-06-11 14:02:28 +02:00
|
|
|
- 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);
|