@Override
    public void populateGui()
    {
        // Filler
        this.getFiller();
        // Items
        for (Map.Entry<Material, Integer> entry : collector.getContents().entrySet())
        {
            // Args
            Material material = entry.getKey();
            int startAmount = entry.getValue();
            double startValue = plugin.getCollectorManager().value(collector, material);
            List<String> lore = Color.color(plugin.getConfig().getStringList("guis.contents.item.lore").stream().map(text -> text.replace("%amount%", String.format("%,d", startAmount)).replace("%value%", String.format("%,.1f", startValue))).collect(Collectors.toList()));
            List<Component> components = lore.stream().map(Component::text).collect(Collectors.toList());
            // Add
            this.addItem(ItemBuilder.from(material).name(Component.text(this.getNicedEnumString(material.name()))).lore(components).asGuiItem(event ->
            {
                // Cancel
                event.setCancelled(true);
                // Args
                Player player = (Player) event.getWhoClicked();
                int amount = collector.getMaterialAmount(material);
                double total = plugin.getCollectorManager().sell(collector, material);
                // Check
                if (total == 0.0d)
                {
                    // TODO: Make it so collectors don't pick up items which can't be sold
                    return;
                }
                // Deposit & Inform
                plugin.getMoneyManager().pay(player.getUniqueId(), total);
                String message = plugin.getConfig().getString("messages.material-sold");
                if (message != null && !message.isEmpty()) player.sendMessage(Color.color(message.replace("%amount%", String.format("%,d", amount)).replace("%material%", this.getNicedEnumString(material.name())).replace("%total%", String.format("%.1f", total))));
                // Update
                this.update();
            }));
        }
        // Navigation
        this.setItem(3, 3, ItemBuilder.from(Material.ARROW).name(Component.text(Color.color("Previous"))).asGuiItem(event -> this.previous()));
        this.setItem(3, 7, ItemBuilder.from(Material.ARROW).name(Component.text(Color.color("Next"))).asGuiItem(event -> this.next()));
    }
@Override
    public void populateGui()
    {
       
        this.getFiller();
       
        for (Map.Entry<Material, Integer> entry : collector.getContents().entrySet())
        {
           
            Material material = entry.getKey();
            int startAmount = entry.getValue();
            double startValue = plugin.getCollectorManager().value(collector, material);
            List<String> lore = Color.color(plugin.getConfig().getStringList("guis.contents.item.lore").stream().map(text -> text.replace("%amount%", String.format("%,d", startAmount)).replace("%value%", String.format("%,.1f", startValue))).collect(Collectors.toList()));
            List<Component> components = lore.stream().map(Component::text).collect(Collectors.toList());
           
            this.addItem(ItemBuilder.from(material).name(Component.text(this.getNicedEnumString(material.name()))).lore(components).asGuiItem(event ->
            {
               
                event.setCancelled(true);
               
                Player player = (Player) event.getWhoClicked();
                int amount = collector.getMaterialAmount(material);
                double total = plugin.getCollectorManager().sell(collector, material);
               
                if (total == 0.0d)
                {
                   
                    return;
                }
               
                plugin.getMoneyManager().pay(player.getUniqueId(), total);
                String message = plugin.getConfig().getString("messages.material-sold");
                if (message != null && !message.isEmpty()) player.sendMessage(Color.color(message.replace("%amount%", String.format("%,d", amount)).replace("%material%", this.getNicedEnumString(material.name())).replace("%total%", String.format("%.1f", total))));
               
                this.update();
            }));
        }
       
        this.setItem(3, 3, ItemBuilder.from(Material.ARROW).name(Component.text(Color.color("Previous"))).asGuiItem(event -> this.previous()));
        this.setItem(3, 7, ItemBuilder.from(Material.ARROW).name(Component.text(Color.color("Next"))).asGuiItem(event -> this.next()));
    }
@override public void populategui() { this.getfiller(); for (map.entry<material, integer> entry : collector.getcontents().entryset()) { material material = entry.getkey(); int startamount = entry.getvalue(); double startvalue = plugin.getcollectormanager().value(collector, material); list<string> lore = color.color(plugin.getconfig().getstringlist("guis.contents.item.lore").stream().map(text -> text.replace("%amount%", string.format("%,d", startamount)).replace("%value%", string.format("%,.1f", startvalue))).collect(collectors.tolist())); list<component> components = lore.stream().map(component::text).collect(collectors.tolist()); this.additem(itembuilder.from(material).name(component.text(this.getnicedenumstring(material.name()))).lore(components).asguiitem(event -> { event.setcancelled(true); player player = (player) event.getwhoclicked(); int amount = collector.getmaterialamount(material); double total = plugin.getcollectormanager().sell(collector, material); if (total == 0.0d) { return; } plugin.getmoneymanager().pay(player.getuniqueid(), total); string message = plugin.getconfig().getstring("messages.material-sold"); if (message != null && !message.isempty()) player.sendmessage(color.color(message.replace("%amount%", string.format("%,d", amount)).replace("%material%", this.getnicedenumstring(material.name())).replace("%total%", string.format("%.1f", total)))); this.update(); })); } this.setitem(3, 3, itembuilder.from(material.arrow).name(component.text(color.color("previous"))).asguiitem(event -> this.previous())); this.setitem(3, 7, itembuilder.from(material.arrow).name(component.text(color.color("next"))).asguiitem(event -> this.next())); }