Skip to content

Commit

Permalink
Add extra failsafe for Shop.yml conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Jul 2, 2024
1 parent 5a4f361 commit 4dc5e5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ public void onFileCreation() {
plugin.saveResource("Shop.yml", true);
reloadData();
// auto conversion
if (!plugin.getGui().isJustCreated()) {
if (!plugin.getGui().isJustCreated() && !plugin.getServerData().isVoteShopConverted()) {
plugin.getLogger().warning("Converting VoteShop configuration to Shop.yml from GUI.yml");
convertFromGUIFile();
}
plugin.getServerData().setShopConverted(true);
}

public void convertFromGUIFile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ public void addAutoCachedPlaceholder(String placeholder) {
}
}

public void setShopConverted(boolean value) {
getData().set("VoteShopConverted", value);
saveData();
}

public boolean isVoteShopConverted() {
return getData().getBoolean("VoteShopConverted");
}

public void updatePlaceholders() {
boolean data = getData().getBoolean("AutoCacheUpdated", false);
if (!data) {
Expand Down

0 comments on commit 4dc5e5c

Please sign in to comment.