aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/startup
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/brysonsteck/Resurrection/startup')
-rw-r--r--src/net/brysonsteck/Resurrection/startup/CheckForUpdate.java8
-rw-r--r--src/net/brysonsteck/Resurrection/startup/ParseSettings.java26
2 files changed, 21 insertions, 13 deletions
diff --git a/src/net/brysonsteck/Resurrection/startup/CheckForUpdate.java b/src/net/brysonsteck/Resurrection/startup/CheckForUpdate.java
index d926057..59c7b30 100644
--- a/src/net/brysonsteck/Resurrection/startup/CheckForUpdate.java
+++ b/src/net/brysonsteck/Resurrection/startup/CheckForUpdate.java
@@ -4,15 +4,21 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
+import org.bukkit.plugin.java.JavaPlugin;
+
+import net.brysonsteck.Resurrection.Resurrection;
+
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
+import java.util.logging.Logger;
public class CheckForUpdate {
boolean success;
String version;
String versionURL;
+ Logger log = JavaPlugin.getProvidingPlugin(Resurrection.class).getLogger();
public CheckForUpdate() {
try {
@@ -26,7 +32,7 @@ public class CheckForUpdate {
versionURL = softwareObj.get("github-release").toString();
success = true;
} catch (IOException e) {
- System.out.println("[Resurrection] An error has occurred while attempting to check for updates.");
+ log.warning("An error has occurred while attempting to check for updates.");
e.printStackTrace();
}
}
diff --git a/src/net/brysonsteck/Resurrection/startup/ParseSettings.java b/src/net/brysonsteck/Resurrection/startup/ParseSettings.java
index 75d24a6..c0c4830 100644
--- a/src/net/brysonsteck/Resurrection/startup/ParseSettings.java
+++ b/src/net/brysonsteck/Resurrection/startup/ParseSettings.java
@@ -6,6 +6,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.*;
import java.util.Hashtable;
+import java.util.logging.Logger;
public class ParseSettings {
Hashtable<String, String> settings = new Hashtable<>();
@@ -15,6 +16,7 @@ public class ParseSettings {
boolean valuesComplete;
public ParseSettings() {
+ Logger log = JavaPlugin.getProvidingPlugin(Resurrection.class).getLogger();
try {
File settingsFile = new File("plugins/settings.resurrection");
if (!settingsFile.exists()) {
@@ -43,25 +45,25 @@ public class ParseSettings {
}
reader.close();
if (!verifySettings()) {
- System.out.println("[Resurrection] There is a syntax issue inside the Settings file:");
+ log.severe("There is a syntax issue inside the Settings file:");
if (!settingsComplete) {
- System.out.println("[Resurrection] The setting \"" + failedSetting + "\" is not present in the settings file.\n" +
- "[Resurrection] Please double check the settings file to make sure the setting exists and a valid corresponding value is set.\n" +
- "[Resurrection] Example: \"resurrection_time=86400000\"\n" +
- "[Resurrection] Example: \"debug=false\"");
+ log.severe(" The setting \"" + failedSetting + "\" is not present in the settings file.");
+ log.severe(" Please double check the settings file to make sure the setting exists and a valid corresponding value is set.");
+ log.severe(" Example: \"resurrection_time=86400000\"");
+ log.severe(" Example: \"debug=false\"");
} else if (!valuesComplete) {
- System.out.println("[Resurrection] The setting \"" + failedSetting + "\" contains an invalid or empty value.\n" +
- "[Resurrection] Please double check the settings file to make sure that a valid value is set for this setting.\n" +
- "[Resurrection] Example: \"resurrection_time=86400000\"\n" +
- "[Resurrection] Example: \"debug=false\"");
+ log.severe("The setting \"" + failedSetting + "\" contains an invalid or empty value.");
+ log.severe(" Please double check the settings file to make sure that a valid value is set for this setting.");
+ log.severe(" Example: \"resurrection_time=86400000\"");
+ log.severe(" Example: \"debug=false\"");
}
- System.out.println("[Resurrection] This file is crucial to Resurrection. Since the file is not complete, the plugin will now stop.");
+ log.severe("This file is crucial to Resurrection. Since the file is not complete, the plugin will now stop.");
Bukkit.getPluginManager().disablePlugin(JavaPlugin.getProvidingPlugin(Resurrection.class));
}
} catch (IOException e) {
- System.out.println("[Resurrection] There was an issue reading the Settings file:");
+ log.severe("There was an issue reading the Settings file:");
e.printStackTrace();
- System.out.println("[Resurrection] This file is crucial to Resurrection. Since the file is not complete, the plugin will now stop.");
+ log.severe("This file is crucial to Resurrection. Since the file is not complete, the plugin will now stop.");
Bukkit.getPluginManager().disablePlugin(JavaPlugin.getProvidingPlugin(Resurrection.class));
}
}