Closed andrewminer closed 7 years ago
Very strange, thanks for reporting it, I'll try to look into it. If you happen to find a way to consistently reproduce it, that'd help a ton.
Think I might have figured out the cause--when two foods have equal diminishing returns values I made the comparison function return a random result, which is not how comparison functions are meant to work (Java requires that if A > B
and B > C
then for any A
, B
and C
: A > C
).
Long story short: I'm a dummy. Will try to get this fixed soon.
That makes a lot of sense. I've got a double-chest with every slot containing a different food item, and I routinely fill my lunchbox from it. Given how often I use it, It's actually a little surprising this is the first time I've encountered this bug!
Yeah, turns out it's actually pretty rare even when I'm trying to trigger it intentionally in test code. I needed to add 50 or so equally diminished foods to a list and then shuffle + sort it 1000 times to trigger the error consistently. Thanks again for reporting it, will be an easy fix.
STEPS
Using Spice of Life 1.3 on Minecraft 1.7.10 with Minecraft Forge 10.13.4.1566:
EXPECTED
The lunchbox gets filled with food.
ACTUAL
In very rare circumstances (which I can't reproduce readily), the following exception is raised which crashes the entire server: