Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Show amount of items available in tablet #1012

Open
ghost opened this issue Oct 18, 2015 · 16 comments
Open

Show amount of items available in tablet #1012

ghost opened this issue Oct 18, 2015 · 16 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Oct 18, 2015

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.

@ghost ghost changed the title [Idea] Show amount of items available in tablet Show amount of items available in tablet Oct 18, 2015
@reapersremorse
Copy link

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.

@ghost
Copy link

ghost commented Oct 19, 2015

@reapersremorse 👍

@iTitus
Copy link
Contributor

iTitus commented Oct 19, 2015

The calculation could run in another thread.

Am 19.10.2015 um 08:30 schrieb anti344 [email protected]:

@reapersremorse


Reply to this email directly or view it on GitHub.

@ghost
Copy link

ghost commented Oct 19, 2015

It wouldn't work if they ran in another thread since the calculation timing needs to be accurate.

@reapersremorse
Copy link

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]:

@reapersremorse


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#1012 (comment)
.

@ghost
Copy link
Author

ghost commented Oct 19, 2015

The numbers would never get that high if you predetermine the amount of slots available in the player's inventory

@iTitus
Copy link
Contributor

iTitus commented Oct 19, 2015

A line in the item's tooltip would suffice. When hovering, the thread could be started and the result can be buffered.

@reapersremorse
Copy link

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.

@ghost
Copy link
Author

ghost commented Oct 19, 2015

Sounds like a good plan

@iTitus
Copy link
Contributor

iTitus commented Oct 19, 2015

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.

@ghost
Copy link

ghost commented Oct 19, 2015

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.

@ghost
Copy link

ghost commented Oct 19, 2015

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.

@iTitus
Copy link
Contributor

iTitus commented Oct 19, 2015

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.

@pahimar pahimar added the idea label May 22, 2016
@pahimar pahimar self-assigned this May 22, 2016
@pahimar
Copy link
Owner

pahimar commented May 22, 2016

I like this idea, I'll try to make it a reality in the Minecraft 1.9 version of EE3

@pahimar pahimar added this to the Roadmap milestone May 28, 2016
@bk5115545
Copy link

bk5115545 commented Jun 23, 2016

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

@pahimar
Copy link
Owner

pahimar commented Jun 23, 2016

There's no need for this to be done in a separate thread. It's a cheap operation.

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

No branches or pull requests

4 participants