add save to disk & backup to int & boolean setting gui.

This commit is contained in:
alexcrea 2024-02-29 19:36:42 +01:00 committed by alexcrea
parent 643487e1a9
commit c5dbbeb67c
8 changed files with 47 additions and 43 deletions

View file

@ -39,9 +39,6 @@ class CustomAnvil : JavaPlugin() {
// Current plugin instance
lateinit var instance: CustomAnvil
// Configuration for unit repair
lateinit var unitRepairConfig: YamlConfiguration
/**
* Logging handler
*/
@ -68,7 +65,7 @@ class CustomAnvil : JavaPlugin() {
// Load config
val success = ConfigHolder.loadConfig();
val success = ConfigHolder.loadConfig()
if(!success) return
// Load metrics

View file

@ -30,11 +30,11 @@ class ReloadExecutor : CommandExecutor {
* Execute the command, return true if success or false otherwise
*/
private fun commandBody(hardfail: Boolean): Boolean{
try {
return ConfigHolder.reloadAllFromDisk(hardfail);
return try {
ConfigHolder.reloadAllFromDisk(hardfail)
}catch (e: Exception){
e.printStackTrace()
return false
false
}
}
}