added check for settings file

This commit is contained in:
Bryson Steck 2021-08-11 20:46:00 -06:00
parent 88494765a7
commit 4f1404492b

View file

@ -87,19 +87,19 @@ public class Resurrection extends JavaPlugin implements Listener {
} else { } else {
System.out.println("[Resurrection] The player data file has been found!"); System.out.println("[Resurrection] The player data file has been found!");
} }
if (!playerFile.exists()) { if (!settingsFile.exists()) {
System.out.println("[Resurrection] Player data file does not exist. Creating now in the \"plugins\" directory..."); System.out.println("[Resurrection] Settings file does not exist. (This file is new with the 0.2 beta if you upgraded.) Creating now in the \"plugins\" directory...");
try { try {
playerFile.createNewFile(); playerFile.createNewFile();
System.out.println("[Resurrection] Player data file created successfully."); System.out.println("[Resurrection] Settings file created successfully.");
} catch (IOException e) { } catch (IOException e) {
System.out.println("[Resurrection] An error has occurred creating the player data file!"); System.out.println("[Resurrection] An error has occurred creating the settings file!");
e.printStackTrace(); e.printStackTrace();
System.out.println("[Resurrection] This file is crucial to Resurrection. Since the file could not be created, the plugin will now stop."); System.out.println("[Resurrection] This file is crucial to Resurrection. Since the file could not be created, the plugin will now stop.");
System.exit(1); System.exit(1);
} }
} else { } else {
System.out.println("[Resurrection] The player data file has been found!"); System.out.println("[Resurrection] The settings file has also been found!");
} }
System.out.println("[Resurrection] ---------------------------------------------------------"); System.out.println("[Resurrection] ---------------------------------------------------------");