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