Allow overriding the head item name
This commit is contained in:
parent
e1f79b6af7
commit
b9150379dc
3 changed files with 12 additions and 6 deletions
|
@ -49,7 +49,7 @@ public class HeadCache
|
|||
private HeadCacheItem()
|
||||
{}
|
||||
|
||||
public ItemStack getAsItem()
|
||||
public ItemStack getAsItem(String itemName)
|
||||
{
|
||||
ItemStack head = new ItemStack(Items.PLAYER_HEAD, 1);
|
||||
|
||||
|
@ -66,8 +66,14 @@ public class HeadCache
|
|||
skullOwner.put("Properties", properties);
|
||||
head.addTagElement(PlayerHeadItem.TAG_SKULL_OWNER, skullOwner);
|
||||
|
||||
Component headname = ChatHelpers.macro("[0]'s Head", name);
|
||||
head.setHoverName(headname);
|
||||
if(itemName == "")
|
||||
{
|
||||
|
||||
Component headname = ChatHelpers.macro("[0]'s Head", name);
|
||||
head.setHoverName(headname);
|
||||
}else {
|
||||
head.setHoverName(ChatHelpers.macro(itemName));
|
||||
}
|
||||
|
||||
return head;
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@ public class HeadUtilities {
|
|||
}
|
||||
}
|
||||
|
||||
public static ItemStack get(String playerName)
|
||||
public static ItemStack get(String playerName, String itemName)
|
||||
{
|
||||
return cachedLookup(playerName).getAsItem();
|
||||
return cachedLookup(playerName).getAsItem(itemName);
|
||||
}
|
||||
|
||||
private static HeadCacheItem externalHeadRequest(String playerName)
|
||||
|
|
Reference in a new issue