Paper/Spigot-Server-Patches/0040-Use-UserCache-for-player-heads.patch
Zach Brown 70ce6ce831
Move version command update checking to the implementation
This makes it easier for downstream projects (forks) to replace the
version fetching system with their own. It is as simple as implementing
an interface and overriding the default implementation of
org.bukkit.UnsafeValues#getVersionFetcher()

It also makes it easier for us to organize things like the version
history feature.

Lastly I have updated the paper implementation to check against the site
API rather than against jenkins.
2019-05-27 04:13:41 -05:00

29 lines
1.2 KiB
Diff

From bed33fb7866d2760f7fb79a8b8534c7468de5764 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Wed, 2 Mar 2016 23:42:37 -0600
Subject: [PATCH] Use UserCache for player heads
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index c83bebe70..0136e1bfe 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -155,7 +155,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (name == null) {
profile = null;
} else {
- profile = new GameProfile(null, name);
+ // Paper start - Use Online Players Skull
+ GameProfile newProfile = null;
+ net.minecraft.server.EntityPlayer player = net.minecraft.server.MinecraftServer.getServer().getPlayerList().getPlayer(name);
+ if (player != null) newProfile = player.getProfile();
+ if (newProfile == null) newProfile = new GameProfile(null, name);
+ profile = newProfile;
+ // Paper end
}
return true;
--
2.21.0