Open sheduxdev opened 3 weeks ago
Good day,
Please make sure you're passing the correct defaults; try outputting the value of file-version
after updating (in your case after creating the document).
Attaching the results from my testing:
String file = "file-version: 1\n" +
"\n" +
"genel-ayarlar:\n" +
" sunucu-adı: \"Oyunlayıcı Network\"\n" +
" sunucu-prefixi: \"&bOyunlayıcı\"\n" +
" sunucu-domaini: \"www.oyunlayici.net\"\n";
String defaults = "file-version: 2\n" +
"\n" +
"genel-ayarlar:\n" +
" sunucu-adı: \"Oyunlayıcı Network\"\n" +
" sunucu-prefixi: \"&bOyunlayıcı\"\n" +
" sunucu-domaini: \"www.oyunlayici.net\"\n" +
"\n" +
"test: \"test\"\n";
YamlDocument document = YamlDocument.create(
new ByteArrayInputStream(file.getBytes(StandardCharsets.UTF_8)),
new ByteArrayInputStream(defaults.getBytes(StandardCharsets.UTF_8)),
GeneralSettings.builder().setKeyFormat(GeneralSettings.KeyFormat.OBJECT).build(),
LoaderSettings.builder().setAutoUpdate(true).build(),
DumperSettings.DEFAULT,
UpdaterSettings.builder().setVersioning(new BasicVersioning("file-version")).build()
);
Dumping the document results in the same contents and structure as your defaults (apart from the quotation).
Have a nice day. ~ dejvokep
My Old Config
My New Config:
My Code
Its doesnt change the config to new one