@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent e) {
// Only looking for anvils
if (!(e.getInventory() instanceof AnvilInventory)) {
return;
}
ItemStack item = e.getCurrentItem();
// Only looking for kits
if (!item.hasItemMeta()) {
return;
}
ItemMeta meta = item.getItemMeta();
if (meta.hasDisplayName() && meta.hasLore() && meta.getDisplayName().startsWith("Kit ")) {
if (meta.getLore().contains(ChestKitsPlugin.LORE_KEY)) {
e.setCancelled(true);
}
}
}
ChestKitsListener.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:ChestKit
作者:
评论列表
文章目录