Waterfall/BungeeCord-Patches/0039-Providing-access-to-the-player-s-LoginResult-on-Logi.patch
LinsaFTW 1efb2d439e
Updated Upstream (BungeeCord) (#844)
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

BungeeCord Changes:
d0fa62d4 Minecraft 24w06a support
464ed018 Improve cookie support during login
eda268b4 Fix 24w05b spectate packet ID
3e100752 #3612: Error when disconnecting player on PostLoginEvent
b52b1469 Add PendingConnection#isTransferred API method
94d5b0d0 Minecraft 24w05b support
c3f228f6 #3610, 3611: inverted isEmpty method on ComponentStyle
02c5c1ee #3602: Minecraft 24w04a support
c69acf72 Add JetBrains java-annotations
a1cd6943 Bump version to 1.20-R0.3-SNAPSHOT
3e2bc8e2 Release 1.20-R0.2
ad7163d2 #3600: Bump io.netty:netty-bom from 4.1.104.Final to 4.1.106.Final
2024-02-24 17:21:31 +00:00

69 lines
3.0 KiB
Diff

From f5bfae46f8cd47ff456069b21862f6efad233421 Mon Sep 17 00:00:00 2001
From: phenomax <phenomax@revayd.net>
Date: Thu, 10 Aug 2017 18:41:17 +0200
Subject: [PATCH] Providing access to the player's LoginResult on LoginEvent
diff --git a/api/src/main/java/net/md_5/bungee/api/event/LoginEvent.java b/api/src/main/java/net/md_5/bungee/api/event/LoginEvent.java
index 4c09efff..46517e03 100644
--- a/api/src/main/java/net/md_5/bungee/api/event/LoginEvent.java
+++ b/api/src/main/java/net/md_5/bungee/api/event/LoginEvent.java
@@ -8,6 +8,7 @@ import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.plugin.Cancellable;
+import net.md_5.bungee.connection.LoginResult; // Waterfall: Parse LoginResult object to new constructor of LoginEvent
/**
* Event called to represent a player logging in.
@@ -26,6 +27,13 @@ public class LoginEvent extends AsyncEvent<LoginEvent> implements Cancellable
* Message to use when kicking if this event is canceled.
*/
private BaseComponent reason;
+ // Waterfall start - adding the LoginResult variable to provide access to it, when calling the login event
+ /**
+ * The player's login result containing his textures
+ */
+ private LoginResult loginResult;
+ // Waterfall end
+
/**
* Connection attempting to login.
*/
@@ -37,6 +45,15 @@ public class LoginEvent extends AsyncEvent<LoginEvent> implements Cancellable
this.connection = connection;
}
+ // Waterfall start - adding new constructor for LoginResult
+ public LoginEvent(PendingConnection connection, Callback<LoginEvent> done, LoginResult loginResult)
+ {
+ super( done );
+ this.connection = connection;
+ this.loginResult = loginResult;
+ }
+ // Waterfall end
+
/**
* @return reason to be displayed
* @deprecated use component methods instead
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java b/api/src/main/java/net/md_5/bungee/connection/LoginResult.java
similarity index 100%
rename from proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java
rename to api/src/main/java/net/md_5/bungee/connection/LoginResult.java
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
index b7dd5fe3..5fd26bf1 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
@@ -644,7 +644,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
};
// fire login event
- bungee.getPluginManager().callEvent( new LoginEvent( InitialHandler.this, complete ) );
+ bungee.getPluginManager().callEvent( new LoginEvent( InitialHandler.this, complete, this.getLoginProfile() ) ); // Waterfall: Parse LoginResult object to new constructor of LoginEvent
}
private void finish2()
--
2.43.0.windows.1