public static boolean isCustomHeadItem(ItemStack item) {
if (item == null) return false;
if (item.getType() != Material.SKULL_ITEM) {
return false;
}
if (item.getDurability() != SkullType.PLAYER.ordinal()) {
return false;
}
ItemMeta meta = item.getItemMeta();
if (meta instanceof SkullMeta) {
SkullMeta skullMeta = (SkullMeta) meta;
if (skullMeta.hasOwner() && skullMeta.getOwner() == null) {
// custom head items usually don't have a valid owner
return true;
}
}
return false;
}
Utils.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:Shopkeepers
作者:
评论列表
文章目录