BottledExpListener.java 文件源码

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

项目:HCFCore 作者:
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
public void onPrepareCraft(PrepareItemCraftEvent event) {
    if (event.getInventory().getHolder() instanceof Player) {
        CraftingInventory inventory = event.getInventory();
        Player player = (Player) inventory.getHolder();
        if (isBottledExperience(inventory.getResult())) {
            int exp = new ExperienceManager(player).getCurrentExp();
            inventory.setResult(exp > 0 ? createExpBottle(exp) : new ItemStack(Material.AIR, 1));
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号