Make configs created automatically

They weren't???
This commit is contained in:
Minecon724 2024-09-22 13:46:49 +02:00
parent 88df6c5781
commit c645d56085
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -51,14 +51,7 @@ 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");
@ -74,6 +67,14 @@ public class RealWeatherPlugin extends JavaPlugin {
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");