diff --git a/pom.xml b/pom.xml index f7e3f3c..2b6a09e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.sat7 DynamicShop - 3.12.0 + 3.12.1 jar DynamicShop diff --git a/src/main/java/me/sat7/dynamicshop/utilities/ConfigUtil.java b/src/main/java/me/sat7/dynamicshop/utilities/ConfigUtil.java index 96959a0..1ef375c 100644 --- a/src/main/java/me/sat7/dynamicshop/utilities/ConfigUtil.java +++ b/src/main/java/me/sat7/dynamicshop/utilities/ConfigUtil.java @@ -4,6 +4,7 @@ import lombok.Setter; import me.sat7.dynamicshop.DynamicShop; import me.sat7.dynamicshop.files.CustomConfig; +import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; @@ -41,7 +42,26 @@ public static void Load() DynamicShop.plugin.saveDefaultConfig(); DynamicShop.plugin.reloadConfig(); - DynamicShop.plugin.getConfig().options().setHeader(header); + + try + { + if(Bukkit.getVersion().contains("1.16") || Bukkit.getVersion().contains("1.17")) + { + StringBuilder temp = new StringBuilder(); + for (String s:header) + { + temp.append(s); + temp.append("\n"); + } + DynamicShop.plugin.getConfig().options().header(temp.toString()); + } + else + { + DynamicShop.plugin.getConfig().options().setHeader(header); + } + } + catch (Exception ignore){} + ConvertV2toV3(); ShopYMLUpdate();