aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-08-11 20:32:42 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-08-11 20:37:30 -0600
commit88494765a73282c3c7b175d8d63701eb27c2aac1 (patch)
tree12521d08ab31b446643913d9e15cf33590cfff2c
parent354d8325c110c30dbe99da3930dbb3374e879dff (diff)
downloadresurrection-88494765a73282c3c7b175d8d63701eb27c2aac1.tar
resurrection-88494765a73282c3c7b175d8d63701eb27c2aac1.tar.gz
resurrection-88494765a73282c3c7b175d8d63701eb27c2aac1.tar.bz2
adding new settings feature
-rw-r--r--data/resurrection.pngbin0 -> 43439 bytes
-rw-r--r--data/settings.resurrection3
-rw-r--r--src/net/brysonsteck/Resurrection/ParseSettings.java5
-rw-r--r--src/net/brysonsteck/Resurrection/Resurrection.java17
4 files changed, 24 insertions, 1 deletions
diff --git a/data/resurrection.png b/data/resurrection.png
new file mode 100644
index 0000000..1fb7807
--- /dev/null
+++ b/data/resurrection.png
Binary files differ
diff --git a/data/settings.resurrection b/data/settings.resurrection
new file mode 100644
index 0000000..3f24b3f
--- /dev/null
+++ b/data/settings.resurrection
@@ -0,0 +1,3 @@
+# This is the default settings file. All lines starting with a '#' are treated as comments and will be ignored.
+# 'resurrection_time' is the amount of time in milliseconds Resurrection will force the player to wait. Default value is 8640000 milliseconds (24 hours).
+resurrection_time=8640000 \ No newline at end of file
diff --git a/src/net/brysonsteck/Resurrection/ParseSettings.java b/src/net/brysonsteck/Resurrection/ParseSettings.java
new file mode 100644
index 0000000..5062208
--- /dev/null
+++ b/src/net/brysonsteck/Resurrection/ParseSettings.java
@@ -0,0 +1,5 @@
+package net.brysonsteck.Resurrection;
+
+public class ParseSettings {
+
+}
diff --git a/src/net/brysonsteck/Resurrection/Resurrection.java b/src/net/brysonsteck/Resurrection/Resurrection.java
index 33fff14..03ec2b1 100644
--- a/src/net/brysonsteck/Resurrection/Resurrection.java
+++ b/src/net/brysonsteck/Resurrection/Resurrection.java
@@ -69,9 +69,24 @@ public class Resurrection extends JavaPlugin implements Listener {
System.out.println("[Resurrection] ---------------------------------------------------------");
- System.out.println("[Resurrection] Locating the file \"playerData.resurrection\"...");
+ System.out.println("[Resurrection] Locating player data and settings files...");
// check if playerData.resurrection exists
File playerFile = new File("plugins/playerData.resurrection");
+ File settingsFile = new File("plugins/settings.resurrection");
+ if (!playerFile.exists()) {
+ System.out.println("[Resurrection] Player data file does not exist. Creating now in the \"plugins\" directory...");
+ try {
+ playerFile.createNewFile();
+ System.out.println("[Resurrection] Player data file created successfully.");
+ } catch (IOException e) {
+ System.out.println("[Resurrection] An error has occurred creating the player data file!");
+ 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.exit(1);
+ }
+ } else {
+ System.out.println("[Resurrection] The player data file has been found!");
+ }
if (!playerFile.exists()) {
System.out.println("[Resurrection] Player data file does not exist. Creating now in the \"plugins\" directory...");
try {