SpongeDocs
SpongeDocs copied to clipboard
Inventory API Explanation
The text from the PR says it all. https://github.com/SpongePowered/SpongeAPI/pull/443 @Mumfrey can we shoe-horn a butchered version of your delicious explanation into the SpongeDocs? It will need to lose some fat, but some of that may be helpful on #62 (Best Practices, WIP).
Of course, although you should bear in mind that the PR document precedes the API itself and basically takes a kind of stream-of-consciousness approach to explaining how the API design was formulated, in order to marshall the reader through the same steps I went through and to give them a better understanding of the reasoning behind a system which is quite different to what they may be familiar with.
Because the document preceded the APi, you should be aware that most of the code examples are subtly wrong, this is because they were effectively pseudocode I wrote to explain my intentions for how the API should work rather than documentation of how it actually does work. I suggest the best way to handle this is for someone to write a draft PR for docs and then tag me on it and I'll note the corrections needed (I'd write it myself but I'm stupidly busy IRL and away from home at the moment for the next week or so).
You may also wish to doctor the diagrams to suit your documentation style and I'm happy to give someone the original vsd file if they want to change the colours/fonts/layout etc.
Inventory is partially done, we need to document this asap.
Is implemented? Only need docs? We can start to use to create custom inventory guis? Thanks.
Some of it has been implemented, and some is still WIP. If you want to volunteer and help document the bits that are currently working, we would be delighted.
I'm not sure what parts are functional, we could use a summary of some kind. @Mumfrey could you kindly bring us all up to speed on this rather ancient bind?
I trying to use this on my plugin:
this.inv = CustomInventory.builder()
.size(this.size)
.name(new FixedTranslation(this.name))
.build();
But i still getting the message: Could not find a Supplier for the provided builder class: org.spongepowered.api.item.inventory.custom.CustomInventory.Builder
Is this te correct or i forgetting some part of API?
It's not implemented. There's a PR currently sitting at https://github.com/SpongePowered/SpongeAPI/pull/1258 and will possibly be merged before 5.0 is released. Until then, I wouldn't bother using custom inventories as they're going to be changed with the PR.
Also, your error shouldn't be posted on the SpongeDocs. This is the wrong place to find support. Follow the PR for updates on the refactor and ask for support on the forums/IRC (unless it's a problem with the docs).
Bump
There is a clean-up/refactoring/implementation of some inventory stuff going on at present by @Faithcaio and others. That may eventually lead to some actual documentation... but HELP is still wanted.
Is someone actually working on this? Maybe you can create a branch so we can start working on it together? :)
@MinusKube Not to my knowledge, but any sort of a start would be appreciated.
The person who knows the most about how this is supposed to work in its' current form is @Faithcaio so it would be of great use if @MinusKube and anyone else available could collaborate and eke out something for this great absence, which also happens to be the VERY OLDEST ISSUE IN THIS REPOSITORY.
Are there any plugins that could be used as an example/demo (for the future doc author)? Or would it be possible to get the documentation from the ones who actually designed it?
AFAICT There is currently nothing about inventories in the docs at all.
Is Item the right place to create the documentation or should it be in its own category?
It's quite possible that inventory handling will be quite large, so keeping it separate might help. It's difficult to predict in advance. Otherwise we could simply rename "Items" to "Items and Inventories".
It's been a common problem for people to adjust the inventories directly, rather then using the transactions, or cancelling the event and making modifications to the inventory, and seeing them rollback and getting confused.
So if an example of a GUI menu is used anywhere, I suggest addressing that, either by showing the user a brand new inventory maybe, or modifying the transactions on the inventory event.
This can be closed with the merging of #897 Let there be CAKE! 🍰