Show amount of items available in tablet
AnZaNaMa opened this issue · 16 comments
Just a thought, you could have a configurable option to show the amount of items that could currently be made (i.e. just put a number where the stack amount usually goes) just an idea.
Im sure that the math involved would cause way to much lag. The table would
have to have a calculated number for each item or a number for each item in
the tablet selection portion of the gui.
This would probibly be a lot harder to impliment than you think considering
the number would be dynamic.
If item value == 8192
And the ammount of emc in the tablet is 999999999999
Then the number of items you could pull out == 122,070,312.49987
If you have that much emc, you could get any item in your tablet unless you
add custom values. (999999999999 is a possible number) so if you have this
much emc in your tablet, it would have to generate a number for every
item.....
But if you modify the idea to only calculate when hovering over the item in
the gui, then this would be easier on your pc. And if you show it on the
tooltips like the stack and single stack already does, it would probibly
work better.
On Oct 18, 2015 4:04 PM, "Andrew Graber" [email protected] wrote:
Just a thought, you could have a configurable option to show the amount of
items that could currently be made (i.e. just put a number where the stack
amount usually goes) just an idea.—
Reply to this email directly or view it on GitHub
#1012.
The calculation could run in another thread.
Am 19.10.2015 um 08:30 schrieb anti344 [email protected]:
—
Reply to this email directly or view it on GitHub.
It wouldn't work if they ran in another thread since the calculation timing needs to be accurate.
If it were acurate enough in another thread, then it would still cause lag
spikes when searching or opening the tablet with a good ammount of emc in
the tablet.
Also if each item had a number on it then you wouldnt be able to see the
numbers after you get more than 100k emc, the numbers would run together...
On Oct 19, 2015 4:49 AM, "iTitus" [email protected] wrote:
The calculation could run in another thread.
Am 19.10.2015 um 08:30 schrieb anti344 [email protected]:
—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub
#1012 (comment)
.
A line in the item's tooltip would suffice. When hovering, the thread could be started and the result can be buffered.
The numbers would never get that high if you predetermine the amount of slots available in the player's inventory
I thought that you were talking about setting a number for each item in the
GUI. I already said that it would be best if the number of items should be
in the tooltip.
Wouldnt there still be a large use of RAM when buffering for each
individual item? If it works it would be pretty useful.
On Oct 19, 2015 8:05 AM, "iTitus" [email protected] wrote:
A line in the item's tooltip would suffice. When hovering, the thread
could be started and the result can be buffered.—
Reply to this email directly or view it on GitHub.
Good thought ;)
Am 19.10.2015 um 16:55 schrieb WolfAmaril [email protected]:
I'm a bit late to the party, but I just had a thought.
Wouldn't it make more sense to show the number of stacks that could be made, as constrained by the number of available slots in the players inventory?That way you'd never have to do a larger string that something like "12, 45" for 12 stacks and 45 more items.
—
Reply to this email directly or view it on GitHub.
The number of EMC in the tablet is known, and the EMC of an item(stack) is known. This is just a simple division. An overflow check beforehand may be necessary. Maybe buffering/threading is not even needed. Lazy is the key here: only calculating when showing the value.
Threading and buffering sound like unnecessary features for this kind of thing. As we know, premature optimization is the root of all evil. Calculating only when showing the value would be the best option here. Lag might still be a problem since the calculation would be done before every frame.
I'm a bit late to the party, but I just had a thought.
Wouldn't it make more sense to show the number of stacks that could be made, as constrained by the number of available slots in the players inventory?
That way you'd never have to do a larger string that something like "12, 45" for 12 stacks and 45 more items.
I like this idea, I'll try to make it a reality in the Minecraft 1.9 version of EE3
I would shy away from making this another thread. Spawning a thread is probably a lot more expensive than computing total / cost for all the items on the page (especially if you're using BigInteger for string mathematics).