Add a warning message when trying to correct invalid configuration.

This commit is contained in:
Kristian S. Stangeland 2012-11-20 06:53:39 +01:00
parent dc186df695
commit d4d763af94

View File

@ -101,8 +101,11 @@ public class ProtocolLibrary extends JavaPlugin {
detailedReporter.reportWarning(this, "Cannot load configuration", e);
// Load it again
deleteConfig();
config = new ProtocolConfig(this);
if (deleteConfig()) {
config = new ProtocolConfig(this);
} else {
reporter.reportWarning(this, "Cannot delete old ProtocolLib configuration.");
}
}
try {
@ -123,8 +126,8 @@ public class ProtocolLibrary extends JavaPlugin {
}
}
private void deleteConfig() {
config.getFile().delete();
private boolean deleteConfig() {
return config.getFile().delete();
}
@Override