geforkt von Mirrors/Paper
26 Zeilen
2.1 KiB
Diff
26 Zeilen
2.1 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/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
index b8fb3f99e4af5768d8afc1b143e5585f08cc21a9..9e9f0fb1dd6b9a92bd84c50ebdbd79beaf45b58c 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
@@ -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();
|
|
+ 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
|
|
PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);
|
|
- 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);
|