Mistake in padding calculation
TomatoCo opened this issue · 7 comments
The PaddingHandler.java (line 92 in commit 33acb04) has this line of code:
final float volume = Math.min(.1f, Math.min(1f, (float) (distanceSq / (cutoffDistance * cutoffDistance))));
But that can't be right. If I set my cutoffDistance to, say, 0.01 (to try and disable the upgrade) then regardless of the distance to the source it's still 0.1. I think that the second Math.min was supposed to be Math.max? ie: Math.min(.1f, Math.max(1f, (float) etcetc... The code looks like it was supposed to clamp values between 0.1 and 1, but that's not what it's doing.
At any rate, the tooltip says "Distance in blocks that is no longer considered 'nearby' by the 'Padding' upgrade. Sounds at least this far away will play normally." When I set it to the default of 15, a block I break 3 blocks away is really quiet. When I set it to 1, a block I break 3 blocks away is STILL really quiet. That's not what the tooltip says it should do.
And as an aside, is it possible to just outright remove this upgrade from a helmet? I thought it would be possible to be selective like Immersive Engineering's Ear Defenders but I can't find a way to do so. I just want it gone but I don't want to redo all of the other upgrades. I couldn't find anything online so that's when I dove into the code and found this bug.
yes, this is wrong. The first min
should be a max
to clamp the volume between 10% and 100%.
Just goes to show how easy it is to make this kind of a goof.
Exactly my thoughts ;).
No, DS upgrades are not removable and having a system for that has been on the TODO list for a long time. We just haven't found time to do it and a good way that fits in with Ender IO.
I wouldn't mind a toggle for it instead of the ability to remove it. I ended up just editing the nbt data to remove my padding upgrade after realizing how drastic it is.