Skip to content

Commit

Permalink
Changes to auto conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Jul 4, 2024
1 parent 2bb3fac commit 549309e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 11 additions & 0 deletions VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,17 @@ private void loadBungeeHandler() {

@Override
public void onPostLoad() {
// auto conversion for Shop.yml
if (plugin.getShopFile().isJustCreated()) {
if (!plugin.getGui().isJustCreated() && !getServerData().isVoteShopConverted()) {
plugin.getLogger().warning("Converting VoteShop configuration to Shop.yml from GUI.yml");
plugin.getShopFile().convertFromGUIFile();
}
getServerData().setShopConverted(true);
} else if (!getServerData().isVoteShopConverted()) {
getServerData().setShopConverted(true);
}

loadVersionFile();
getOptions().setServer(bungeeSettings.getServer());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@ public void loadValues() {
@Override
public void onFileCreation() {
plugin.saveResource("Shop.yml", true);
reloadData();
// auto conversion
if (!plugin.getGui().isJustCreated()) {
plugin.getLogger().warning("Converting VoteShop configuration to Shop.yml from GUI.yml");
convertFromGUIFile();
}
}

public void convertFromGUIFile() {
Expand Down

0 comments on commit 549309e

Please sign in to comment.