// Args
@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()));
    }
for (Map.Entry<Material, Integer> entry : collector.getContents().entrySet())
{
// Args
Material material = entry.getKey();
int startAmount = entry.getValue();
@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);
@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;
}