Paper/patches/api/0299-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
Jason bc127ea819
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6222)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
eec4aab0 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent
205213c6 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron

CraftBukkit Changes:
b8c522d5 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent
f04a77dc SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron
d1dbcebc SPIGOT-6653: Canceling snow bucket placement removes snow from bucket
4f34a67b #891: Fix scheduler task ID overflow and duplication issues

Spigot Changes:
d03d7f12 BUILDTOOLS-604: Rebuild patches
2021-07-18 09:41:53 +02:00

51 lines
2.2 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/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index 033960f566861e303b9cb61aae4c02add501d93f..694a81769076ea58aae9f14f076ab80c9952c957 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -20,6 +20,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
private net.kyori.adventure.text.Component message; // Paper
//private String name; // Paper - Not used anymore
private final InetAddress ipAddress;
+ private final InetAddress rawAddress; // Paper
//private UUID uniqueId; // Paper - Not used anymore
@Deprecated
@@ -49,7 +50,23 @@ public class AsyncPlayerPreLoginEvent extends Event {
this.profile = profile;
}
+ // Paper Start
+ /**
+ * Gets the raw address of the player logging in
+ * @return The address
+ */
+ @NotNull
+ public InetAddress getRawAddress() {
+ return rawAddress;
+ }
+ // Paper end
+
+ @Deprecated
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
+ this(name, ipAddress, ipAddress, uniqueId, profile);
+ }
+
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
super(true);
this.profile = profile;
// Paper end
@@ -57,6 +74,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
this.message = net.kyori.adventure.text.Component.empty(); // Paper
//this.name = name; // Paper - Not used anymore
this.ipAddress = ipAddress;
+ this.rawAddress = rawAddress; // Paper
//this.uniqueId = uniqueId; // Paper - Not used anymore
}