@Override @Nonnull public ItemStack getSkull(Player player, String itemName) { MaterialAndData skullType = skullItems.get(EntityType.PLAYER); if (skullType == null) { return new ItemStack(Material.AIR); } ItemStack skull = skullType.getItemStack(1); ItemMeta meta = skull.getItemMeta(); if (itemName != null) { meta.setDisplayName(itemName); } skull.setItemMeta(meta); DeprecatedUtils.setSkullOwner(skull, player.getName(), null); return skull; }
@Override @Nonnull public ItemStack getSkull(UUID uuid, String itemName, ItemUpdatedCallback callback) { MaterialAndData skullType = skullItems.get(EntityType.PLAYER); if (skullType == null) { return new ItemStack(Material.AIR); } ItemStack skull = skullType.getItemStack(1); ItemMeta meta = skull.getItemMeta(); if (itemName != null) { meta.setDisplayName(itemName); } skull.setItemMeta(meta); SkullLoadedCallback skullCallback = null; if (callback != null) { skullCallback = new SkullLoadedCallback() { @Override public void updated(ItemStack itemStack) { callback.updated(itemStack); } }; } DeprecatedUtils.setSkullOwner(skull, uuid, skullCallback); return skull; }
@Override @Nonnull public ItemStack getSkull(String ownerName, String itemName, final ItemUpdatedCallback callback) { MaterialAndData skullType = skullItems.get(EntityType.PLAYER); if (skullType == null) { ItemStack air = new ItemStack(Material.AIR); if (callback != null) { callback.updated(air); } return air; } ItemStack skull = skullType.getItemStack(1); ItemMeta meta = skull.getItemMeta(); if (itemName != null) { meta.setDisplayName(itemName); } skull.setItemMeta(meta); SkullLoadedCallback skullCallback = null; if (callback != null) { skullCallback = new SkullLoadedCallback() { @Override public void updated(ItemStack itemStack) { callback.updated(itemStack); } }; } DeprecatedUtils.setSkullOwner(skull, ownerName, skullCallback); return skull; }
DeprecatedUtils.setSkullOwner(skull, ownerName, skullCallback); } else if (callback != null) { callback.updated(skull);
DeprecatedUtils.setSkullOwner(stack, skullData.playerName, skullCallback);