Sodium

Sodium

35M Downloads

Entity Distance does not save

NoComment1105 opened this issue ยท 5 comments

commented

Expected Behavior

When altering entity distance you set it to what you want and click apply

Actual Behavior

It just resets to 100% each time

Reproduction Steps

Not exactly causing a crash just what I noticed

  1. Go into settings
  2. Alter entity distance, click apply and leave settings
  3. go back into settings and see 100%

System Information

  • Java Version: [1.8.0_51 64-bit]
  • CPU: [Intel i5 5300 U @2.30GHz]
  • GPU: [Intel HD Graphics 5500]
  • DirectX: [Version 12]
  • RAM: [8 GB]
commented

@NoComment1105 Are you still able to reproduce this? I can't reproduce the issue, the value is saved properly for me.

commented

@NoComment1105 Are you still able to reproduce this? I can't reproduce the issue, the value is saved properly for me.

Yes i am still able to reproduce, however it is only when you lower the entity distance and not when you raise it

commented

Confirmed on the latest commit (currently jellysquid3@885222a).

Analysis
It looks like the problematic line of code is the Math.round() function here. Since the values for Entity Distance 50% and 75% are converted to 0.5 and 0.75 respectively, the Math.round() function rounds them to the nearest integer (which would be 1.0 or 100%). This has the effect of the option appearing not to save even though it is saving a rounded result. I'm not sure what the best fix for this would be, as I'm not sure of Jelly's preferences or alternative rounding operations to use.

commented

Confirmed on the latest commit (currently 885222a).

Analysis
It looks like the problematic line of code is the Math.round() function here. Since the values for Entity Distance 50% and 75% are converted to 0.5 and 0.75 respectively, the Math.round() function rounds them to the nearest integer (which would be 1.0 or 100%). This has the effect of the option appearing not to save even though it is saving a rounded result. I'm not sure what the best fix for this would be, as I'm not sure of Jelly's preferences or alternative rounding operations to use.

OK, thanks for still looking into it even though you couldn't reproduce initially, will this be fixed for the next version?

commented

In 1.16.2+, you can save it above 100%. It just won't do anything.