mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Fix Profile Textures and expand PlayerProfile .complete() API
I mistakenly thought .complete() also checked for textures, which was not the case So the logic was not working as desired. Also some undesired logic paths lead to textures of the logging in player being dropped, forcing us to always load the textures immediately again on login, leading to rate limits. Everythings now good the .complete() api now will default specify to also complete textures, but you may pass false to it to skip loading textures.
This commit is contained in:
@@ -18,8 +18,37 @@ index 4b82e43a8..35fde8b23 100644
|
||||
private ItemStack bV;
|
||||
private final ItemCooldown bW;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index 2842956bf..8aeded425 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
public final NetworkManager networkManager;
|
||||
private LoginListener.EnumProtocolState g;
|
||||
private int h;
|
||||
- private GameProfile i;
|
||||
+ private GameProfile i; private void setGameProfile(GameProfile profile) { i = profile; } private GameProfile getGameProfile() { return i; } // Paper - OBFHELPER
|
||||
private final String j;
|
||||
private SecretKey loginKey;
|
||||
private EntityPlayer l;
|
||||
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
|
||||
|
||||
// Paper start
|
||||
- PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName);
|
||||
+ PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(getGameProfile());
|
||||
AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
|
||||
server.getPluginManager().callEvent(asyncEvent);
|
||||
profile = asyncEvent.getPlayerProfile();
|
||||
- profile.complete();
|
||||
- i = CraftPlayerProfile.asAuthlibCopy(profile);
|
||||
+ profile.complete(true);
|
||||
+ setGameProfile(CraftPlayerProfile.asAuthlib(profile));
|
||||
playerName = i.getName();
|
||||
uniqueId = i.getId();
|
||||
// Paper end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 21631c588..9c894185b 100644
|
||||
index 21631c588..1e73a3308 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -82,7 +111,7 @@ index 21631c588..9c894185b 100644
|
||||
+ }
|
||||
+ }
|
||||
+ public PlayerProfile getPlayerProfile() {
|
||||
+ return new CraftPlayerProfile(this);
|
||||
+ return new CraftPlayerProfile(this).clone();
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
|
Reference in New Issue
Block a user