adding new settings feature
This commit is contained in:
parent
354d8325c1
commit
88494765a7
4 changed files with 24 additions and 1 deletions
BIN
data/resurrection.png
Normal file
BIN
data/resurrection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
3
data/settings.resurrection
Normal file
3
data/settings.resurrection
Normal file
|
@ -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
|
5
src/net/brysonsteck/Resurrection/ParseSettings.java
Normal file
5
src/net/brysonsteck/Resurrection/ParseSettings.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package net.brysonsteck.Resurrection;
|
||||||
|
|
||||||
|
public class ParseSettings {
|
||||||
|
|
||||||
|
}
|
|
@ -69,9 +69,24 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
System.out.println("[Resurrection] ---------------------------------------------------------");
|
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
|
// check if playerData.resurrection exists
|
||||||
File playerFile = new File("plugins/playerData.resurrection");
|
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()) {
|
if (!playerFile.exists()) {
|
||||||
System.out.println("[Resurrection] Player data file does not exist. Creating now in the \"plugins\" directory...");
|
System.out.println("[Resurrection] Player data file does not exist. Creating now in the \"plugins\" directory...");
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue