Mekanism

Mekanism

111M Downloads

CC: setBurnRate causing obscure error when value is greater than maxBurnRate

saismeesaimonsaimes opened this issue ยท 3 comments

commented

Issue description

The setBurnRate function gives an obscure error "d != java.lang.Double" when providing a number greater than the maxBurnRate possible with the current amount of fuel rods.
image

Steps to reproduce

Wrap the reactor as a peripheral
Run reactor.setBurnRate() and provide a number greater than the max (ex: reactor.setBurnRate(reactor.getMaxBurnRate() + 1))
See obscure error, rather than something more sensible

Minecraft version

1.19.2 (Latest)

Forge version

43.2.3

Mekanism version

10.3.5

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

commented

I will try and look at this a little but I am not sure it will be something I can fix as we already have a better error message, so unless something is failing only slightly higher up the chain where we wrap various types... I think it might be failing in CC land before even being passed to us.

Also don't getters usually require parenthesis? Or is that not the case in CC/lua. Aka shouldn't it maybe be reactor.setBurnRate(reactor.getMaxBurnRate() + 1)

commented

Also don't getters usually require parenthesis? Or is that not the case in CC/lua. Aka shouldn't it maybe be reactor.setBurnRate(reactor.getMaxBurnRate() + 1)

Yeah, sorry, just made a typo in my issue.

commented

Well that is depressingly hilarious but it is definitely on my end so I can fix for 10.3.8... The error is being thrown by the string formatter that tries to format the error message... So I will need to look at it a bit more and probably fix a bunch of other places as well.