From c1aae0979096944fa86b41495f39a7085497bb7e Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Wed, 16 Jun 2021 16:50:42 -0600 Subject: implemented playerdata --- src/net/brysonsteck/Resurrection/Resurrection.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/net/brysonsteck/Resurrection/Resurrection.java') diff --git a/src/net/brysonsteck/Resurrection/Resurrection.java b/src/net/brysonsteck/Resurrection/Resurrection.java index 52e910b..5bb2683 100644 --- a/src/net/brysonsteck/Resurrection/Resurrection.java +++ b/src/net/brysonsteck/Resurrection/Resurrection.java @@ -67,18 +67,20 @@ public class Resurrection extends JavaPlugin implements Listener { public static void main(String[] args) { - // DO THISgit + // DO THIS PlayerData playerData = new PlayerData(); System.out.println("--- Reading Player data file ---"); playerData.readData(); System.out.println(playerData.getPlayers()); System.out.println(playerData.getRawData()); System.out.println("--- Oh look! A new player joined. Adding them. ---"); - playerData.saveData("bryzinga,false,0"); + String rawData = playerData.getRawData(); + rawData = rawData + ";bryzinga,false,0"; + playerData.saveData(rawData); System.out.println(playerData.getPlayers()); System.out.println(playerData.getRawData()); System.out.println("--- A player has died! Update the data file! ---"); - String rawData = playerData.getRawData(); + rawData = playerData.getRawData(); String[] rawPlayers = rawData.split(";"); String[] rawSinglePlayer = new String[3]; int index = 0; @@ -95,6 +97,7 @@ public class Resurrection extends JavaPlugin implements Listener { index++; } rawData = String.join(";", rawPlayers); + playerData.saveData(rawData); System.out.println(rawData); } -- cgit v1.2.3