mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
update config dependency
This commit is contained in:
+4
-3
@@ -84,11 +84,12 @@ public class CommandUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
ConfigFile dumpFile = ConfigFile.loadConfig(file);
|
||||
dumpFile.set("commands", serverCommands);
|
||||
|
||||
try {
|
||||
ConfigFile dumpFile = ConfigFile.loadConfig(file);
|
||||
dumpFile.set("commands", serverCommands);
|
||||
dumpFile.save();
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
+12
-3
@@ -24,13 +24,22 @@ public class ConfigCache {
|
||||
this.canDoProtocolLib = canDoProtocolLib;
|
||||
this.logger = logger;
|
||||
|
||||
reloadConfig();
|
||||
try {
|
||||
reloadConfig();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean reloadConfig() {
|
||||
|
||||
createFiles();
|
||||
config = ConfigFile.loadConfig(configFile);
|
||||
try {
|
||||
config = ConfigFile.loadConfig(configFile);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
config.addDefault("messages.prefix", "CommandWhitelist > ");
|
||||
config.addDefault("messages.command_denied", "No such command.");
|
||||
@@ -106,7 +115,7 @@ public class ConfigCache {
|
||||
try {
|
||||
config.save();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user