diff --git a/src/main/java/online/meinkraft/customvillagertrades/CustomVillagerTrades.java b/src/main/java/online/meinkraft/customvillagertrades/CustomVillagerTrades.java index 282f298..e986cab 100644 --- a/src/main/java/online/meinkraft/customvillagertrades/CustomVillagerTrades.java +++ b/src/main/java/online/meinkraft/customvillagertrades/CustomVillagerTrades.java @@ -39,7 +39,7 @@ public void onEnable() { } // create config files if it doesn't exist - saveDefaultConfig(); + createConfig(); createTradesConfig(); // set config values @@ -81,6 +81,11 @@ public void onDisable() { } + private void createConfig() { + getConfig().options().copyDefaults(true); + saveConfig(); + } + private void createTradesConfig() { tradesConfigFile = new File(getDataFolder(), "trades.yml"); diff --git a/src/test/resources/config.yml b/src/test/resources/config.yml deleted file mode 100644 index 638454d..0000000 --- a/src/test/resources/config.yml +++ /dev/null @@ -1,26 +0,0 @@ -trades: - - - result: - material: DIAMOND - amount: 32 - ingredients: - - material: TROPICAL_FISH - amount: 4 - maxUses: 4 - chance: 0.5 - professions: [MASON, BUTCHER] - levels: [2, 3] - experienceReward: 2 - villagerExperience: 2 - types: [DESERT, SNOW, TAIGA] - biomes: [DESERT] - - - result: - material: EMERALD - amount: 24 - ingredients: - - material: IRON_INGOT - amount: 10 - maxUses: 4 - chance: 0.5 - professions: [MASON]