From 8dda4723807c48d9426402c2e48744f45a6795c6 Mon Sep 17 00:00:00 2001 From: DevDrizzy Date: Sat, 27 Jul 2024 21:34:17 +0500 Subject: [PATCH] Fixed: YamlStorage line splitting logic Signed-off-by: DevDrizzy --- src/main/java/xyz/refinedev/api/storage/YamlStorage.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/refinedev/api/storage/YamlStorage.java b/src/main/java/xyz/refinedev/api/storage/YamlStorage.java index 880601d..99fa706 100644 --- a/src/main/java/xyz/refinedev/api/storage/YamlStorage.java +++ b/src/main/java/xyz/refinedev/api/storage/YamlStorage.java @@ -14,6 +14,7 @@ import org.simpleyaml.configuration.file.YamlFile; import org.simpleyaml.configuration.implementation.api.QuoteStyle; +import org.simpleyaml.configuration.implementation.snakeyaml.SnakeYamlImplementation; import xyz.refinedev.api.storage.annotations.ConfigValue; import xyz.refinedev.api.storage.data.PluginData; @@ -270,11 +271,13 @@ public void clearConfig() { public void setupConfigOptions(YamlConfigurationOptions options) { this.config.setCommentFormat(YamlCommentFormat.PRETTY); - options.charset(Charsets.UTF_8); + options.charset(com.google.common.base.Charsets.UTF_8); options.useComments(true); options.quoteStyleDefaults().setQuoteStyle(String.class, QuoteStyle.DOUBLE); options.quoteStyleDefaults().setQuoteStyle(List.class, QuoteStyle.DOUBLE); - options.header(String.join("\n", this.getHeader())); + + SnakeYamlImplementation implementation = (SnakeYamlImplementation) options.configuration().getImplementation(); + implementation.getDumperOptions().setSplitLines(false); } /**