类org.bukkit.inventory.EnchantingInventory源码实例Demo

下面列出了怎么用org.bukkit.inventory.EnchantingInventory的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: UhcCore   文件: CutCleanListener.java
@EventHandler
public void onInventoryClick(InventoryClickEvent e){
    Inventory inv = e.getInventory();
    ItemStack item = e.getCurrentItem();
    if (!unlimitedLapis) return;
    if (inv == null || item == null) return;

    if (inv instanceof EnchantingInventory){

        if (item.getType().equals(lapis.getType())){
            e.setCancelled(true);
        }else {
            e.getInventory().setItem(1, lapis);
        }
    }
}
 
源代码2 项目: UhcCore   文件: CutCleanListener.java
@EventHandler
public void openInventoryEvent(InventoryOpenEvent e){
    if (!unlimitedLapis) return;

    if (e.getInventory() instanceof EnchantingInventory){
        e.getInventory().setItem(1, lapis);
    }
}
 
源代码3 项目: UhcCore   文件: CutCleanListener.java
@EventHandler
public void closeInventoryEvent(InventoryCloseEvent e){
    if (!unlimitedLapis) return;

    if (e.getInventory() instanceof EnchantingInventory){
        e.getInventory().setItem(1, null);
    }
}
 
 类所在包
 同包方法