SpongeDocs icon indicating copy to clipboard operation
SpongeDocs copied to clipboard

Inventory API Explanation

Open Inscrutable opened this issue 9 years ago • 14 comments

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).

Inscrutable avatar Mar 14 '15 12:03 Inscrutable

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.

Mumfrey avatar Mar 23 '15 14:03 Mumfrey

Inventory is partially done, we need to document this asap.

Tzky avatar Jan 10 '16 13:01 Tzky

Is implemented? Only need docs? We can start to use to create custom inventory guis? Thanks.

FabioZumbi12 avatar Aug 10 '16 08:08 FabioZumbi12

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?

Inscrutable avatar Aug 10 '16 09:08 Inscrutable

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?

FabioZumbi12 avatar Aug 12 '16 19:08 FabioZumbi12

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).

12awsomeman34 avatar Aug 12 '16 21:08 12awsomeman34

Bump

XakepSDK avatar Aug 19 '17 10:08 XakepSDK

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.

Inscrutable avatar Aug 20 '17 02:08 Inscrutable

Is someone actually working on this? Maybe you can create a branch so we can start working on it together? :)

MinusKube avatar Jan 28 '18 18:01 MinusKube

@MinusKube Not to my knowledge, but any sort of a start would be appreciated.

ryantheleach avatar Jan 28 '18 19:01 ryantheleach

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.

Inscrutable avatar Feb 15 '18 10:02 Inscrutable

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?

ST-DDT avatar Sep 04 '18 19:09 ST-DDT

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".

Inscrutable avatar Sep 05 '18 03:09 Inscrutable

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.

ryantheleach avatar Sep 10 '18 13:09 ryantheleach

This can be closed with the merging of #897 Let there be CAKE! 🍰

Inscrutable avatar Aug 30 '22 11:08 Inscrutable