Added EnchantmentConfig#save

This commit is contained in:
Auxilor 2022-01-08 13:39:46 +00:00
parent f148121981
commit 8f1873e3eb

View File

@ -120,13 +120,24 @@ public class EnchantmentConfig extends ConfigWrapper<Config> {
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();
}
}
}