Skip to content

Commit

Permalink
Hotfix for MC1.16~1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
7sat committed Mar 7, 2023
1 parent 521bf7f commit 99f7059
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.sat7</groupId>
<artifactId>DynamicShop</artifactId>
<version>3.12.0</version>
<version>3.12.1</version>
<packaging>jar</packaging>

<name>DynamicShop</name>
Expand Down
22 changes: 21 additions & 1 deletion src/main/java/me/sat7/dynamicshop/utilities/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 99f7059

Please sign in to comment.