@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled=true)
public void onInvClose(InventoryCloseEvent event) {
Inventory topinv = event.getView().getTopInventory();
if (!(topinv instanceof EnchantingInventory)) {
return;
}
EnchantingInventory enchinv = (EnchantingInventory) topinv;
ItemStack lapisEnch = enchinv.getSecondary();
enchinv.setSecondary(null);
if (lapisEnch != null) {
Player player = (Player) event.getPlayer();
player.getInventory().addItem(lapisEnch).values().forEach(rem -> player.getWorld().dropItem(player.getLocation(), rem));
}
}
EnchantingTableHandler.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:ProtocolSupportLegacySupport
作者:
评论列表
文章目录