Add player head item name

This commit is contained in:
Eric 2016-07-01 16:43:55 +02:00
parent c975437b66
commit 582cc76c83

View File

@ -14,6 +14,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.potion.PotionType;
import java.util.ArrayList;
@ -918,6 +919,10 @@ public class LanguageUtils {
return meta.getDisplayName();
} else if (meta instanceof BookMeta) {
return ((BookMeta) meta).getTitle();
} else if (meta instanceof SkullMeta) {
if (((SkullMeta) meta).hasOwner()) {
return String.format(langConfig.getString("item.skull.player.name", "%s's Head"), ((SkullMeta) meta).getOwner());
}
}
}