Skip to content

Commit

Permalink
YamlFile: set flow style to BLOCK, not FLOW
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Oct 30, 2024
1 parent df11b72 commit e1c8ecf
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -60,7 +58,7 @@ public HashMap<String, Object> getMap() {
@NotNull
private Yaml getNewYaml() {
final DumperOptions dumperOptions = new DumperOptions();
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.FLOW);
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
return new Yaml(dumperOptions);
}

Expand All @@ -85,8 +83,8 @@ public boolean save() {
if (!exists() && !MCFiles.create(file))
return false;
try {
Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
writer.write(yaml.dump(keys));
final FileWriter writer = new FileWriter(file, StandardCharsets.UTF_8);
yaml.dump(keys, writer);
writer.close();
return true;
} catch (IOException e) {
Expand Down

0 comments on commit e1c8ecf

Please sign in to comment.