-
Notifications
You must be signed in to change notification settings - Fork 347
Show amount of items available in tablet #1012
Comments
Im sure that the math involved would cause way to much lag. The table would This would probibly be a lot harder to impliment than you think considering If item value == 8192 If you have that much emc, you could get any item in your tablet unless you But if you modify the idea to only calculate when hovering over the item in
|
The calculation could run in another thread.
|
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
|
The numbers would never get that high if you predetermine the amount of slots available in the player's inventory |
A line in the item's tooltip would suffice. When hovering, the thread could be started and the result can be buffered. |
I thought that you were talking about setting a number for each item in the Wouldnt there still be a large use of RAM when buffering for each On Oct 19, 2015 8:05 AM, "iTitus" [email protected] wrote:
|
Sounds like a good plan |
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. That way you'd never have to do a larger string that something like "12, 45" for 12 stacks and 45 more items. |
Good thought ;)
|
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). |
There's no need for this to be done in a separate thread. It's a cheap operation. |
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.
The text was updated successfully, but these errors were encountered: