ChestKitsListener.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:ChestKit 作者:
@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);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号