2015-09-13 00:57:39 +00:00
|
|
|
From 0f4e46792341188dde721938d5eefb995c64620b Mon Sep 17 00:00:00 2001
|
2015-08-11 06:27:18 +00:00
|
|
|
From: Techcable <Techcable@outlook.com>
|
|
|
|
Date: Fri, 7 Aug 2015 19:31:31 -0700
|
|
|
|
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
|
2015-08-15 19:05:03 +00:00
|
|
|
index ce5425f..25e32a0 100644
|
2015-08-11 06:27:18 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
2015-08-15 19:05:03 +00:00
|
|
|
@@ -6,6 +6,11 @@ import net.minecraft.server.GameProfileSerializer;
|
|
|
|
import net.minecraft.server.NBTBase;
|
|
|
|
import net.minecraft.server.NBTTagCompound;
|
|
|
|
|
|
|
|
+// PaperSpigot start
|
|
|
|
+import net.minecraft.server.EntityPlayer;
|
|
|
|
+import net.minecraft.server.MinecraftServer;
|
|
|
|
+// PaperSpigot end
|
|
|
|
+
|
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.configuration.serialization.DelegateDeserialization;
|
|
|
|
import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta;
|
|
|
|
@@ -132,7 +137,10 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
2015-08-11 06:27:18 +00:00
|
|
|
if (name == null) {
|
|
|
|
profile = null;
|
|
|
|
} else {
|
|
|
|
- profile = new GameProfile(null, name);
|
2015-08-15 19:05:03 +00:00
|
|
|
+ // PaperSpigot start - Check usercache if the player is online
|
|
|
|
+ EntityPlayer player = MinecraftServer.getServer().getPlayerList().getPlayer(name);
|
|
|
|
+ profile = player != null ? player.getProfile() : new GameProfile(null, name);
|
|
|
|
+ // PaperSpigot end
|
2015-08-11 06:27:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
--
|
2015-09-13 00:57:39 +00:00
|
|
|
2.5.1
|
2015-08-11 06:27:18 +00:00
|
|
|
|