У меня есть графический интерфейс, и когда я нажимаю на уголь материала, мне нужно нажать на него еще раз, чтобы активировать код.Вот мой инвентарьclickevent
String stripname = ChatColor.stripColor(e.getClickedInventory().getName());
if(stripname.equals("Upgrade Spawner".toUpperCase()))
{
if(e.getCursor()!=null)
{
if(e.getCursor().getType()!=null)
{
Material item = e.getCursor().getType();
if(item.equals(Material.STAINED_GLASS_PANE)) e.setCursor(null);
else if(item.equals(Material.COAL))
{
if(checkBalance(e.getWhoClicked(), config.getInt("Coal Cost")))
{
takeAwayMoney(e.getWhoClicked(), config.getInt("Coal Cost"));
e.getWhoClicked().closeInventory();
e.getWhoClicked().sendMessage(ChatColor.GREEN + "Iron Golems now drop coal!");
} else
{
e.getWhoClicked().closeInventory();
e.getWhoClicked().sendMessage(ChatColor.RED + "You do not have the requirment amount of money! You need " + getMoneyNeeded(e.getWhoClicked(), config.getInt("Coal Cost")) + " more!");
}
}
}
}
}