Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Fix skull items not displaying skins #146

Open
wants to merge 1 commit into
base: real1.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions CraftBukkit/0105-Fix-skull-items-not-displaying-skins.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From d16baea641c129325cf8547f0de387718bbc2214 Mon Sep 17 00:00:00 2001
From: ShinyDialga45 <shinydialga45@gmail.com>
Date: Sun, 17 May 2015 20:05:31 -0500
Subject: [PATCH] Fix skull items not displaying skins


diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index 89912bc..bdde9aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -5,6 +5,7 @@ import java.util.Map;
import net.minecraft.server.GameProfileSerializer;
import net.minecraft.server.NBTTagCompound;

+import net.minecraft.server.TileEntitySkull;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be using fully qualified names rather than imports for patches

import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta;
@@ -26,7 +27,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return;
}
CraftMetaSkull skullMeta = (CraftMetaSkull) meta;
- this.profile = skullMeta.profile;
+ profile = TileEntitySkull.b(skullMeta.profile);
}

CraftMetaSkull(NBTTagCompound tag) {
@@ -37,6 +38,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
} else if (tag.hasKeyOfType(SKULL_OWNER.NBT, 8) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) {
profile = new GameProfile(null, tag.getString(SKULL_OWNER.NBT));
}
+ profile = TileEntitySkull.b(profile);
}

CraftMetaSkull(Map<String, Object> map) {
@@ -95,7 +97,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (name == null) {
profile = null;
} else {
- profile = new GameProfile(null, name);
+ profile = TileEntitySkull.b(new GameProfile(null, name));
}

return true;
@@ -119,7 +121,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (meta instanceof CraftMetaSkull) {
CraftMetaSkull that = (CraftMetaSkull) meta;

- return (this.hasOwner() ? that.hasOwner() && this.profile.equals(that.profile) : !that.hasOwner());
+ return (this.hasOwner() ? that.hasOwner() && profile.equals(that.profile) : !that.hasOwner());
}
return true;
}
@@ -133,8 +135,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
Builder<String, Object> serialize(Builder<String, Object> builder) {
super.serialize(builder);
if (hasOwner()) {
- return builder.put(SKULL_OWNER.BUKKIT, this.profile.getName());
+ return builder.put(SKULL_OWNER.BUKKIT, profile.getName());
}
return builder;
}
-}
+}
\ No newline at end of file
--
1.9.4.msysgit.2