aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/player/PlayerData.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/brysonsteck/Resurrection/player/PlayerData.java')
-rw-r--r--src/net/brysonsteck/Resurrection/player/PlayerData.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net/brysonsteck/Resurrection/player/PlayerData.java b/src/net/brysonsteck/Resurrection/player/PlayerData.java
index a8a1192..cc82952 100644
--- a/src/net/brysonsteck/Resurrection/player/PlayerData.java
+++ b/src/net/brysonsteck/Resurrection/player/PlayerData.java
@@ -1,16 +1,20 @@
package net.brysonsteck.Resurrection.player;
+import net.brysonsteck.Resurrection.Resurrection;
+import org.bukkit.plugin.java.JavaPlugin;
+
import java.io.*;
import java.util.Arrays;
import java.util.Hashtable;
public class PlayerData {
Hashtable<String, Hashtable<String, String>> playerData = new Hashtable<>();
+ String rawData;
public void saveData(String write) {
try {
FileWriter writer = new FileWriter("data/player.data");
- writer.write(write);
+ writer.write(rawData + ";" + write);
writer.close();
readData();
} catch (IOException e) {
@@ -20,6 +24,7 @@ public class PlayerData {
public void readData() {
try {
+ rawData = "";
BufferedReader reader = new BufferedReader(new FileReader("data/player.data"));
String line = "";
String[] playerData;
@@ -29,6 +34,7 @@ public class PlayerData {
if (line == null) {
break;
}
+ rawData = rawData + line;
playerData = line.split(",");
Hashtable<String, String> playerHash = new Hashtable<>();
playerHash.put("dead", playerData[1]);
@@ -43,4 +49,8 @@ public class PlayerData {
public Hashtable<String, Hashtable<String, String>> getPlayers() {
return playerData;
}
+
+ public String getRawData() {
+ return rawData;
+ }
}