tchristofferson / Config-Updater

Used to update files for Bukkit/Spigot API
MIT License
67 stars 9 forks source link

Deleted sections #15

Closed owljackob closed 2 years ago

owljackob commented 2 years ago
      Ranges:
        '1':
          Action: ACTION
        '2':
          Action: ACTION
        '3':
          Action: ACTION
        '4':
          Action: ACTION

would become

      Ranges:
MetallicGoat commented 2 years ago
      Ranges:
        '1':
          Action: ACTION
        '2':
          Action: ACTION
        '3':
          Action: ACTION
        '4':
          Action: ACTION

would become

      Ranges:

Then tell the config manager to ignore that configuration section......

owljackob commented 2 years ago

Yes, I could do that, but I want to update the old configs. It leads to this issue and I think that it's worth noting it doesn't work as it should.

tchristofferson commented 2 years ago

I can take a look at this at some point. The section should be deleted if it is removed from the default config (resource in the jar).

owljackob commented 2 years ago

The issue seems to be with '.

tchristofferson commented 2 years ago

@realjackowl What version of Spigot are you using? I am noticing a weird bug where if I do config.load(file) it doesn't actually load the file on 1.8.8. However, in 1.18.1 it works correctly. In 1.8.8 If instead of config.load(file) I do config = YamlConfiguration.load(file) it works.

owljackob commented 2 years ago

@tchristofferson Paper 1.18.1.

tchristofferson commented 2 years ago

In my test I added in commit 7741c33957d5b08ddb15f0fbf91fdf5cc731f263 the removed section is deleted after calling the update method.

owljackob commented 1 year ago

That's the problem because the section wasn't deleted from updated config, it was only edited... but updating that removed it.