Cheos137 / ArmorpointsPlusplus

A light-weight mod overhauling vanilla ui components
https://modrinth.com/mod/armorpoints
MIT License
2 stars 2 forks source link

[Bug]: Config values reset #83

Open N0aW opened 11 months ago

N0aW commented 11 months ago

Is there an existing issue for this?

Are you using the latest version currently available?

Description

The "Protection Representation" config value keeps resetting to 0.0 every time I leave a server.

Version

3.1.x for Minecraft Fabric 1.20+

Version

No response

To Reproduce

  1. Set the "Protection Representation" config to any value other than 0.0
  2. Restart Minecraft
  3. The value is reset to 0.0

Expexted Behavior

The config value keeps itself after leaving a server / restarting the game.

Additional Context

This bug occurs when changing the config via Mod Menu / armorpointspp.json5

Screenshots

No response

Relevant Log / Crash-Report Output

No response

N0aW commented 11 months ago

The value seems to reset randomly too.

N0aW commented 10 months ago

It happened on value 0.625, but not on value 1.0

Might have something to do with decimals

Cheos137 commented 10 months ago

can't see what's causing this at a glance - if anything, it technically should fallback to the default value of 0.5 if anything goes wrong internally

will have to investigate

NolanHewitt commented 6 months ago

Can confirm this happens to me. The representative value for protection I had set at 0.5, but it keeps resetting to 0.0 making it so I don't see it at all.

NolanHewitt commented 5 months ago

Found a fix, once you have all the settings in the config set to what you want, set the config file to read only.

Cheos137 commented 5 months ago

Found a fix, once you have all the settings in the config set to what you want, set the config file to read only.

this likely only prevents any changes from written to the file and does not stop the internal config state from being changed/reset/overridden

on another note, i have double-checked my code and am currently suspecting some bug in the config library i'm using - i have yet to find the time to investigate further