Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenBlocks tank getTankInfo #274

Open
redstonedude0 opened this issue Mar 11, 2018 · 1 comment
Open

OpenBlocks tank getTankInfo #274

redstonedude0 opened this issue Mar 11, 2018 · 1 comment

Comments

@redstonedude0
Copy link

It has previously been noted in
#42 and #43
that the getTankInfo() for an openblocks tank only returns the data for 1 tank, not the entire structure, however this does not fit with the return type or getAdvancedMethodsData - specifically the method getTankInfo() returns a table of tanks with only 1 element, it ought to just return the 1 element if it is only going to return 1 tank.
Furthermore, and probably more importantly, the getAdvancedMethodsData for getTankInfo states "A table of tanks will be returned, each with a table of information", clearly making it seem like getTankInfo is meant to return more than 1 tank if relevant, this ought to be changed to either "A table of information will be returned", or "A table of 1 tank will be returned, represented by a table of information"

@boq
Copy link
Member

boq commented Mar 11, 2018

Everything seems to work as expected. In general, blocks can contain more than one tank, so this call always returns list. It would be counter-intuitive to sometimes return return tank info info instead of list of tank infos - single element is different from list of elements with size 1. For more details, look here for code - as you can see, it directly wraps part of Forge's fluid API, which always returns array.

As for OpenBlocks tanks: they are not multiblock structure, just separate tanks with balancing feature. Since single block is single tank, it always returns one entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants