From cea9b0a3097b0ff90d9844e1c31aababac603dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E9=9B=A8=E8=90=BD?= Date: Fri, 8 Nov 2024 13:04:27 +0800 Subject: [PATCH] Picked from cc875d17. (Closes #1539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秋雨落 --- .../common/mixin/core/network/ServerPlayNetHandlerMixin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/ServerPlayNetHandlerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/ServerPlayNetHandlerMixin.java index 2ab6d4ada..9f66aa5a1 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/ServerPlayNetHandlerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/ServerPlayNetHandlerMixin.java @@ -172,6 +172,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Arrays; @@ -1951,4 +1952,8 @@ public void teleport(Location dest) { public void bridge$teleport(Location dest) { teleport(dest); } + + public SocketAddress getRawAddress() { + return this.connection.channel.remoteAddress(); + } }