Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
26 Zeilen
1.9 KiB
Diff
26 Zeilen
1.9 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 573963a09f15046cfcaab83aef906801ce70d75a..99275a8bc2e7bf242ff3c5b5c29924af5328327a 100644
|
||
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||
|
@@ -325,12 +325,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||
|
// Paper end
|
||
|
String playerName = gameProfile.getName();
|
||
|
java.net.InetAddress address = ((java.net.InetSocketAddress) connection.getRemoteAddress()).getAddress();
|
||
|
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper
|
||
|
java.util.UUID uniqueId = gameProfile.getId();
|
||
|
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.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);
|