MinusKube / SmartInvs

Advanced Inventory API for your Minecraft Bukkit plugins.
https://minuskube.gitbook.io/smartinvs/
Apache License 2.0
263 stars 65 forks source link

Confused #164

Open BluuKiwi opened 4 years ago

BluuKiwi commented 4 years ago

There are not enough examples.

Please add some more examples to the documentation. As of right now, I am confused on how to make context-based inventories. Everything in the examples seems to be static and global.

Whenever I try to make a new instance of an inventory, it throws even more errors.

Please add more to the documentation on gitbook. There are a few examples that don't explore much other than basic inventory creation.

BluuKiwi commented 4 years ago

Maybe a 30 min video tutorial that covers all you need to know? This would really help.

titivermeesch commented 3 years ago

@TrashToggled What do you mean by context based? You mean opening the inventory with data from outside? For example a UI that requires data from a player?

If that's the case you could just write something like this:

public class AllTasksMenu implements InventoryProvider {
    public SmartInventory INVENTORY;

    public AllTasksMenu() {
        INVENTORY = SmartInventory.builder()
                .id("all-tasks")
                .provider(this)
                .manager(Main.getInventoryManager())
                .size(6, 9)
                .title("§9§lAll tasks")
                .build();
    }

    @Override
    public void init(Player player, InventoryContents contents) {
    }

    @Override
    public void update(Player player, InventoryContents contents) {
    }
}

This is a basic principle of Java so the owner is not going to explain every use-case, even if a context-based example couldn't hurt I guess @MinusKube

MinusKube commented 3 years ago

There's a very small example at the end of this page in the docs, but, yes, it's not much. But I've planned to add more examples and more info, and I will probably start to work on these things (as well as the other parts of the project) next month.