From 549309ee8c0184696ab644c67e3f265fda86f33c Mon Sep 17 00:00:00 2001 From: BenCodez Date: Thu, 4 Jul 2024 09:44:11 -0400 Subject: [PATCH] Changes to auto conversion --- .../com/bencodez/votingplugin/VotingPluginMain.java | 11 +++++++++++ .../com/bencodez/votingplugin/config/ShopFile.java | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMain.java b/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMain.java index 7a6215aad..a1a5cf7e4 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMain.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/VotingPluginMain.java @@ -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()); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/config/ShopFile.java b/VotingPlugin/src/com/bencodez/votingplugin/config/ShopFile.java index 8be0d76bf..71db3987d 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/config/ShopFile.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/config/ShopFile.java @@ -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() {