The comparator output from a brewing stand is inconsistent between the different slots in the stand.
What I expected to happen was if the top slot in the brewing stand had a full stack of items but the three lower slots were empty, the comparator output would be about a quarter of the full fifteen - say four. This would have been consistent with the comparator output from a chest where, if a third of the slots are full of stacks of items, the output is five.
What actually happened was the comparator output was fifteen. However, if the top slot is empty but one of the lower slots has a water bottle, the output is only four, as expected.
Steps to Reproduce:
1. Place a brewing stand with an adjacent comparator and enough redstone to see the output level.
2. Put a stack of nether wart (for example) in the top slot of the brewing stand's GUI.
3. Check the output level - fifteen.
This also affected the previous snapshot.
UPDATE: Having read Dinnerbone's explanation of the algorithm in MC-6165, the problem appears to be that the top slot is assumed to only be able to hold a single item. If four items are placed in the slot it is calculated as being 400% full, giving an average over the four slots of 100% and hence an output level of fifteen. With anything over four items in the top slot, the brewing stand is calculated as over 100% full and the output is capped at fifteen.
This may be related to MC-2034 - the top slot does not work as expected when shift-clicking items into the brewing stand.
Linked issues
is duplicated by 1
relates to 1
Comments 18
well in my opinion this fix is plain useless, my programmable potionmaker is now completly broken!
there should be at least a change of ONE redstonelevel in between NOTHING in the top slot and MORE THAN NOTHING! This is a broken fix!
You're right there, error on my part. Math.ceil would be what the equation in my head was using.
So, Math.ceil[ ( Number of bottles in bottom slots /3) * ( Weight of Bottom Slots ) + ( Number of items in the top slot /64) * ( 15- Weight of Bottom Slots ) ]
My previous example had the Weight of Bottom Slots set at 7. Changed the formula a bit to allow for inequality of a brewing stand with just bottles in it and a brewing stand with just a stack of items. Weight of Bottom Slots set at 11 is the closest value to have all slots to have equal weight overall, since 15*3/4 = 11.25. If only we could submit RFEs on this site instead of just bugs. Could post something on the Suggestions Board, but I fear this topic will be drowned out by the abstract requests. An official response would be helpful to know if we're not wasting our time.
Just a thought. Instead of using a formula, it may be better to just use a table whenever a comparator is used with a container. Something like:
Percent Full | RS Output |
---|---|
0 | 0 |
(0, 5] | 1 |
(5, 10] | 2 |
(10, 20] | 3 |
(20, 25] | 4 |
(25, 30] | 5 |
(30, 40] | 6 |
(40, 50] | 7 |
(50, 60] | 8 |
(60, 70] | 9 |
(70, 75] | 10 |
(75, 80] | 11 |
(80, 90] | 12 |
(90, 95] | 13 |
(95, 100) | 14 |
100 | 15 |
This way every output change would be meaningful and since 75% would output 10 and above 75% would output 11 it would solve this problem too.
I like the idea of using a table to determine the output strength. It would fix the issue and can be applied to all containers. The problem with it is coding it for efficiency. As far as my programming skill get me, I can only come up with a block of if statements to determine the output. We'll be dealing with a continuous variable, so a pre-rendered array or table can't be used. So it will have to be checked during run time, every time there is an update. It'll add at most 16 code routines when a one-off equation will do it faster. Might cause unnecessary lag.
I've just set up MCP on my computer and I'm starting to look at the source code to see if I can gleam some ideas from there. With the 1.5.1 update coming out soon, I don't think our issue will be addressed. Maybe a mod will come out to fix this.
accessing a table is pretty as fast as making a floatingpoint calculation imho! But more a burden to the memory if not used in a static way. But i must admit that i never tested it for myself i just heared it from my professor years ago XD
Comparisons aren't that bad on performance. I would think in some cases having a complex formula is worse. They could also use a switch statement which would be slightly faster.
If this actually caused some lag they could rewrite the code to do a bisection search of the table. Worse case it would have to compare four times. However, I don't think the size of the table really warrants it.
Confirmed.