summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2014-05-03 17:42:19 -0500
committerTravis Watkins <amaranth@ubuntu.com>2014-05-03 17:49:59 -0500
commit690a908b971e327c5f77ed73d8d52a7556570afd (patch)
tree619ec6df87e91ff56ac1c3537d8b4495c5123564 /src/main/java/org
parent33e472229ef8c9f36261c596ea3f2a896be0f8a5 (diff)
downloadcraftbukkit-690a908b971e327c5f77ed73d8d52a7556570afd.tar
craftbukkit-690a908b971e327c5f77ed73d8d52a7556570afd.tar.gz
craftbukkit-690a908b971e327c5f77ed73d8d52a7556570afd.tar.lz
craftbukkit-690a908b971e327c5f77ed73d8d52a7556570afd.tar.xz
craftbukkit-690a908b971e327c5f77ed73d8d52a7556570afd.zip
Avoid using the user cache in skull meta.
To handle changes in 1.7.9 we changed skull meta to use GameProfile instances instead of strings of player names. This reflects what vanilla is actually storing for skulls now. As skulls still require a name our API was not changed and we instead look up the rest of the profile information from the name. The way this was implemented made it so that deserializing a skull or setting its name potentially involved a network request. As skull meta itself does not actually require a complete profile we now simply create one that only contains a name and leave populating it to the server when it is actually needed.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index 15e114df..2fe10005 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -36,7 +36,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (tag.hasKeyOfType(SKULL_OWNER.NBT, 10)) {
profile = GameProfileSerializer.a(tag.getCompound(SKULL_OWNER.NBT));
} else if (tag.hasKeyOfType(SKULL_OWNER.NBT, 8)) {
- profile = MinecraftServer.getServer().getUserCache().a(tag.getString(SKULL_OWNER.NBT));
+ profile = new GameProfile(null, tag.getString(SKULL_OWNER.NBT));
}
}
@@ -93,12 +93,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return false;
}
- GameProfile profile = MinecraftServer.getServer().getUserCache().a(name);
- if (profile == null) {
- return false;
+ if (name == null) {
+ profile = null;
+ } else {
+ profile = new GameProfile(null, name);
}
- this.profile = profile;
return true;
}