Refactor reload method and remove redundant debug logs

This commit is contained in:
akastijn 2025-07-15 21:12:27 +02:00
parent ab86d77069
commit 42c9530348

View File

@ -55,42 +55,28 @@ public class AltitudeParticles extends JavaPlugin {
public void reload() {
Logger.info("Reloading AltitudeParticles...");
Config.reload();
Logger.info("1");
DatabaseConfig.reload();
Logger.info("2");
ParticleConfig.reload();
Logger.info("3");
startAutoReload();
}
private static void startAutoReload() {
Path path = Path.of(Config.AUTO_RELOAD_PATH);
Logger.info("4");
File file = path.toFile();
Logger.info("5");
if (file.exists() && file.isDirectory()) {
Logger.info("6");
try {
Logger.info("7");
if (autoReload != null) {
Logger.info("8-bad");
autoReload.stop();
Logger.info("9-bad");
}
Logger.info("8");
autoReload = new AutoReload(path);
Logger.info("9");
autoReload.startWatching();
Logger.info("10");
} catch (IOException e) {
Logger.info("error 1");
Logger.severe("Failed to start AutoReload at path %", Config.AUTO_RELOAD_PATH);
Logger.info("error 2");
Logger.error("Failed to start AutoReload", e);
Logger.info("error 3");
}
Logger.info("11");
} else {
Logger.info("6-bad");
Logger.severe("Failed to start AutoReload at path %", Config.AUTO_RELOAD_PATH);
}
Logger.info("12");
}
}