I use lists of config sections to save simple data files.
This would previously serialize as a list of maps. As of 1.18.2 this does not serialize properly:
list:
- !!org.bukkit.configuration.MemoryConfiguration
defaults: null
Test plugin: https://github.com/NathanWolf/Bukkit-Unit-Tests/releases/tag/config-lists
Code:
YamlConfiguration newConfig = new YamlConfiguration(); List<ConfigurationSection> configList = new ArrayList<>(); MemoryConfiguration newSection = new MemoryConfiguration(); newSection.set("something", "value"); configList.add(newSection); newConfig.set("list", configList); try { File outputFile = new File(getDataFolder(), "data.yml"); newConfig.save(outputFile); getLogger().info("Wrote to: " + outputFile.getAbsolutePath()); } catch (IOException ex) { getLogger().severe("Could not save file: " + ex.getMessage()); }
This is going to cause a lot of data loss for my users with flatfile storage when they update.
I have not narrowed down the specific change, though I see a few suspects. As far as I know things have been working fine since the "save comments" re-work, so I think it's a more recent change.