+ * Gets the PlayerProfile of the player logging in
+ * @return The Profile
+ */
+ @NotNull
+ public PlayerProfile getPlayerProfile() {
+ return profile;
+ }
+
+ /**
+ * Changes the PlayerProfile the player will login as
+ * @param profile The profile to use
+ */
+ public void setPlayerProfile(@NotNull PlayerProfile profile) {
+ this.profile = profile;
+ }
+
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
super(true);
+ this.profile = profile;
+ // Paper end
this.result = Result.ALLOWED;
this.message = net.kyori.adventure.text.Component.empty(); // Paper
- this.name = name;
+ //this.name = name; // Paper - Not used anymore
this.ipAddress = ipAddress;
- this.uniqueId = uniqueId;
+ //this.uniqueId = uniqueId; // Paper - Not used anymore
}
/**
@@ -193,7 +221,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
*/
@NotNull
public String getName() {
- return name;
+ return profile.getName(); // Paper
}
/**
@@ -213,7 +241,7 @@ public class AsyncPlayerPreLoginEvent extends Event {