private boolean charge(Player player, RuneType type) {
        if (player.getGameMode() == GameMode.CREATIVE) {
            return true;
        }
        int goldIngots = 0;
        for (ItemStack item : player.getInventory().getContents()) {
            if (item != null && item.getType() == Material.GOLD_NUGGET) {
                goldIngots += item.getAmount();
            }
        }
        if (goldIngots < type.getCost()) {
            return false;
        }
        goldIngots = type.getCost();
        while (goldIngots > 0) {
            int slot = player.getInventory().first(Material.GOLD_NUGGET);
            ItemStack item = player.getInventory().getItem(slot);
            while (item.getAmount() > 0 && goldIngots > 0) {
                goldIngots--;
                item.setAmount(item.getAmount() - 1);
            }
            if (item.getAmount() == 0) {
                player.getInventory().setItem(slot, new ItemStack(Material.AIR));
            }
        }
        player.updateInventory();
        return true;
    }