Make configs created automatically
They weren't???
This commit is contained in:
parent
88df6c5781
commit
c645d56085
1 changed files with 10 additions and 9 deletions
|
@ -51,15 +51,8 @@ public class RealWeatherPlugin extends JavaPlugin {
|
||||||
thunderConfiguration, timeConfiguration;
|
thunderConfiguration, timeConfiguration;
|
||||||
|
|
||||||
DebugLogger.info("loading configurations", 1);
|
DebugLogger.info("loading configurations", 1);
|
||||||
|
boolean firstRun = !new File(dataFolder, "config.yml").exists();
|
||||||
if (!new File(dataFolder, "config.yml").exists()) {
|
|
||||||
logger.warning("This is the first time running this plugin.");
|
|
||||||
logger.warning("Please shut down the server, review the config files, and enter your API keys.");
|
|
||||||
|
|
||||||
getServer().getPluginManager().disablePlugin(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
configuration = getConfig("config.yml");
|
configuration = getConfig("config.yml");
|
||||||
mapConfiguration = getConfig("map.yml");
|
mapConfiguration = getConfig("map.yml");
|
||||||
|
@ -73,6 +66,14 @@ public class RealWeatherPlugin extends JavaPlugin {
|
||||||
getServer().getPluginManager().disablePlugin(this);
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstRun) {
|
||||||
|
logger.warning("This is the first time running this plugin.");
|
||||||
|
logger.warning("Please shut down the server, review the config files, and enter your API keys.");
|
||||||
|
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DebugLogger.baseLogger = logger;
|
DebugLogger.baseLogger = logger;
|
||||||
DebugLogger.debugLevel = configuration.getInt("debug");
|
DebugLogger.debugLevel = configuration.getInt("debug");
|
||||||
|
|
Loading…
Reference in a new issue