Starlight infusion and consuming liquid starlight
belathus opened this issue ยท 1 comments
Per my other issue, I've created a bunch of recipes to process other ores. I noticed that other recipes in the code use a consumption chance of 0.05 (5%, I suppose), so I set my recipes to be the same. All good.
After a while of processing the ores and other things, I've been noticing that I've had to replace the liquid starlight far more often than 5%; sometimes 3-4 times in a row I have to replace the liquid starlight and it feels overall closer to 50% of the time, so I looked through the code.
From what I can interpret from your code here, it steps through each of the blocks of liquid starlight and rolls the 5% chance to consume one for each block (12 times). If it succeeds on the roll, it breaks the loop, so only one is consumed if the recipe isn't set to consume multiple. Unless I'm doing my math wrong, this results in about a 46% chance that starlight is consumed when set to 0.05.
It isn't impossible to keep up with, as once you know how to do it, it isn't hard to make a ton of liquid starlight, but it is a pain in the butt to have to replace that liquid manually (I haven't messed with the chalices yet and didn't really know they could be used with the starlight infusion until I was digging through the code). I'm just curious if the relatively high rate of starlight consumption is intended for the "low consumption" recipes, and if not, I suggest randomly choosing a block of liquid starlight and rolling the "consuption chance" only once on that one block (unless Consume Multiple is true, in which case, use your current code).
Working as intended. Removal of 1/12 blocks seems pretty "low chance", even if it's a 46% combined chance it actually removes at least one. The chalice alters that process, some.
And multiple consumption doesn't keep going after it removes a source block until it tries them all, it redoes the loop until it's tried the requisite number of times.