Project MMO

Project MMO

10M Downloads

TOML Files Regenerate On Load

SomewhatDamaged opened this issue ยท 5 comments

commented

Describe the bug
The .toml files all seem to be rebuilt to default standards on load. I added an extra comment to each one, and every single file had that comment removed after loading the game.

Expected behavior
The files should maintain any changes to them and only be rebuilt if they are removed.

To Reproduce
Steps to reproduce the behavior:

  1. Edit each toml file in minecraft/saves/<save name>/serverconfig to have an extra comment
  2. Start minecraft and load that save, then exist
  3. Check the files and see the extra comments are gone

Versions:

  • Minecraft: 1.19.2
  • Loader: Forge-43.2.4
  • PMMO: 1.19-3.0.2
  • Java: 18

Additional context
Mentioned this might be the case in bug #231

commented

I will let Caltinor chime in on this because I am still at 1.16.5 so I am not 100% familiar with later versions but I think you will find that in the 1.19 version of the mod you are meant to use datapacks not the toml configs to apply custom configuration.

https://github.com/Caltinor/Project-MMO-2.0/wiki/Configuring-PMMO#config-toml-files

There are toml files to configure still.

commented

I will let Caltinor chime in on this because I am still at 1.16.5 so I am not 100% familiar with later versions but I think you will find that in the 1.19 version of the mod you are meant to use datapacks not the toml configs to apply custom configuration.
Reference: https://github.com/Caltinor/Project-MMO-2.0/wiki/Configuring-PMMO

commented

Also you will find adding an extra comment to a lot of configs will cause them to be removed. Most config is constructed by Forge provided functions with a template and if it doesn't conform to the template at boot it will get invalidated and corrected/regenerated.

Edit: Again, not familiar with exactly how it is being handled in 1.19, might be the changes you are making and where you are making them are expected and accounted for in the generator ๐Ÿ‘

commented

This particular issue is not a bug. The "specification" for a standard config includes the comments as part of the value declaration. Adding extra comments is not permitted. However, if the object you are parsing is a list/map like the perks json is, then the extra comments are ignored. This is because I use a custom parser for those objects which is a subset of the forge config spec.

long story short, you can't add comments by Forge's design.

commented

I have this configuration:

Minecraft: 1.19.2
Loader: Forge-43.2.6
I've not install PMMO and the bug still here

The weird thing is i play like 2 week normaly and this bug appear from nowhere