Revert recent changes around player skulls using user cache

Fixes #3637
Dieser Commit ist enthalten in:
Aikar 2020-06-28 05:03:22 -04:00
Ursprung a8ffecc741
Commit 5fc45f4db0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE

Datei anzeigen

@ -466,48 +466,6 @@ index ed32242bd169e9f28607942aa31aa48a5799b215..54f80cb8e1b771f2a493543e04f8bc83
public MinecraftSessionService getMinecraftSessionService() {
return this.minecraftSessionService;
}
diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
index 177cceb77f8783fe93ba7e4342de9c589f155c1b..83faa9dc5f74df4609cab34a66e4feed12990463 100644
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
@@ -158,6 +158,7 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
private void f() {
// Spigot start
GameProfile profile = this.gameProfile;
+ if (profile != null && profile.isComplete() && profile.getProperties().containsKey("textures")) return; // Paper
b(profile, new Predicate<GameProfile>() {
@Override
@@ -178,7 +179,16 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
} else if (MinecraftServer.getServer() == null) {
callback.apply(gameprofile);
} else {
- GameProfile profile = skinCache.getIfPresent(gameprofile.getName().toLowerCase(java.util.Locale.ROOT));
+ // Paper start
+ com.destroystokyo.paper.profile.CraftPlayerProfile paperProfile = new com.destroystokyo.paper.profile.CraftPlayerProfile(gameprofile);
+ if (sync) {
+ // might complete by cache, but if not, go ahead and do it now, avoid the code below
+ paperProfile.complete(true, true);
+ } else {
+ paperProfile.completeFromCache(false, true);
+ }
+ GameProfile profile = paperProfile.getGameProfile();
+ // Paper end
if (profile != null && Iterables.getFirst(profile.getProperties().get("textures"), (Object) null) != null) {
callback.apply(profile);
@@ -187,7 +197,10 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
Callable<GameProfile> callable = new Callable<GameProfile>() {
@Override
public GameProfile call() {
- final GameProfile profile = skinCache.getUnchecked(gameprofile.getName().toLowerCase(java.util.Locale.ROOT));
+ // Paper start
+ paperProfile.complete(true, true);
+ final GameProfile profile = paperProfile.getGameProfile();
+ // Paper end
MinecraftServer.getServer().processQueue.add(new Runnable() {
@Override
public void run() {
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 581199e6dcddb3692ccc6b6cf6c42fa5ef1f5e7e..39d2f83531d539fb96824c2e6a9018c12ea75272 100644
--- a/src/main/java/net/minecraft/server/UserCache.java