@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));
}
}
}
BottledExpListener.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:HCFCore
作者:
评论列表
文章目录