Skip to content

Commit

Permalink
Reload config on cvtreload/cvtenable command
Browse files Browse the repository at this point in the history
  • Loading branch information
Reldeam committed Mar 1, 2022
1 parent 4ad5ea1 commit 971bbe2
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ protected CustomVillagerTrades(
@Override
public void onLoad() {

// create config file if it doesn't exist
createConfig();

// load the language config
loadLanguageConfig();
loadConfig();

// register ConfigurationSerializable classes
ConfigurationSerialization.registerClass(VillagerData.class);
Expand Down Expand Up @@ -147,6 +143,9 @@ public void onLoad() {
@Override
public void onEnable() {

// ensure config is loaded/reloaded
loadConfig();

// ensure plugin doesn't get enabled more than once
if(loaded) {
getLogger().warning(getMessage("pluginAlreadyEnabled"));
Expand Down Expand Up @@ -274,6 +273,16 @@ public void onDisable() {

}

public void loadConfig() {

// create config file if it doesn't exist
createConfig();

// load the language config
loadLanguageConfig();

}

@Override
public FileConfiguration getTradesConfig() {
return tradesConfig;
Expand Down

0 comments on commit 971bbe2

Please sign in to comment.