diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/config/configs/EnchantmentConfig.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/config/configs/EnchantmentConfig.java index 3b6b25d5..cb08e034 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/config/configs/EnchantmentConfig.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/config/configs/EnchantmentConfig.java @@ -120,13 +120,24 @@ public class EnchantmentConfig extends ConfigWrapper { this.getPlugin().getLangYml().set("enchantments." + this.getEnchant().getKey().getKey(), null); try { - if (this.getHandle() instanceof LoadableConfig loadableConfig) { - loadableConfig.save(); - } + this.save(); this.getPlugin().getLangYml().save(); this.getPlugin().getLangYml().clearCache(); } catch (IOException e) { e.printStackTrace(); } } + + /** + * Save if savable config. + */ + public void save() { + try { + if (this.getHandle() instanceof LoadableConfig loadableConfig) { + loadableConfig.save(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } }