fixed file location
This commit is contained in:
parent
c1aae09790
commit
bb6e126297
6 changed files with 32 additions and 3 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,6 +9,8 @@ import org.bukkit.event.Listener;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
public class Resurrection extends JavaPlugin implements Listener {
|
public class Resurrection extends JavaPlugin implements Listener {
|
||||||
|
@ -39,8 +41,30 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
System.out.println("[Resurrection] is up-to-date for more features and bug fixes. The plugin");
|
System.out.println("[Resurrection] is up-to-date for more features and bug fixes. The plugin");
|
||||||
System.out.println("[Resurrection] will now check for updates.");
|
System.out.println("[Resurrection] will now check for updates.");
|
||||||
System.out.println("[Resurrection] ---------------------------------------------------------");
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
} else {
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("[Resurrection] Locating the file \"playerData.resurrection\"...");
|
||||||
|
// check if playerData.resurrection exists
|
||||||
|
File playerFile = new File("playerData.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();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("[Resurrection] The player data file has been found!");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
|
|
||||||
// check for updates
|
// check for updates
|
||||||
System.out.println("[Resurrection] Checking for updates...");
|
System.out.println("[Resurrection] Checking for updates...");
|
||||||
CheckForUpdate check = new CheckForUpdate();
|
CheckForUpdate check = new CheckForUpdate();
|
||||||
|
@ -54,6 +78,8 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
System.out.println("[Resurrection] " + newestVersionURL);
|
System.out.println("[Resurrection] " + newestVersionURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
// register listener
|
// register listener
|
||||||
this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||||
|
|
||||||
|
@ -62,7 +88,10 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
this.getCommand("about").setExecutor(new CommandAbout());
|
this.getCommand("about").setExecutor(new CommandAbout());
|
||||||
this.getCommand("resurrect").setExecutor(new CommandResurrect());
|
this.getCommand("resurrect").setExecutor(new CommandResurrect());
|
||||||
|
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
System.out.println("[Resurrection] Successfully Started!");
|
System.out.println("[Resurrection] Successfully Started!");
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -13,19 +13,19 @@ public class PlayerData {
|
||||||
|
|
||||||
public void saveData(String write) {
|
public void saveData(String write) {
|
||||||
try {
|
try {
|
||||||
FileWriter writer = new FileWriter("data/player.data");
|
FileWriter writer = new FileWriter("playerData.resurrection");
|
||||||
writer.write(write);
|
writer.write(write);
|
||||||
writer.close();
|
writer.close();
|
||||||
readData();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
readData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readData() {
|
public void readData() {
|
||||||
try {
|
try {
|
||||||
rawData = "";
|
rawData = "";
|
||||||
BufferedReader reader = new BufferedReader(new FileReader("data/player.data"));
|
BufferedReader reader = new BufferedReader(new FileReader("data/playerData.resurrection"));
|
||||||
String line = "";
|
String line = "";
|
||||||
String[] playerData;
|
String[] playerData;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue