acutally fixed file location
This commit is contained in:
parent
bb6e126297
commit
bf005f030b
5 changed files with 35 additions and 34 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -25,6 +25,8 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
super.onEnable();
|
super.onEnable();
|
||||||
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
System.out.println("[Resurrection] Resurrection is starting!");
|
System.out.println("[Resurrection] Resurrection is starting!");
|
||||||
PluginDescriptionFile pluginInfo = getDescription();
|
PluginDescriptionFile pluginInfo = getDescription();
|
||||||
getServer().getPluginManager().registerEvents(this, this);
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
|
@ -64,7 +66,6 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
System.out.println("[Resurrection] ---------------------------------------------------------");
|
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();
|
||||||
|
@ -80,11 +81,11 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
System.out.println("[Resurrection] ---------------------------------------------------------");
|
System.out.println("[Resurrection] ---------------------------------------------------------");
|
||||||
|
|
||||||
|
System.out.println("[Resurrection] Registering listeners and adding commands...");
|
||||||
// register listener
|
// register listener
|
||||||
this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||||
|
|
||||||
// register commands
|
// register commands
|
||||||
System.out.println("[Resurrection] Adding commands...");
|
|
||||||
this.getCommand("about").setExecutor(new CommandAbout());
|
this.getCommand("about").setExecutor(new CommandAbout());
|
||||||
this.getCommand("resurrect").setExecutor(new CommandResurrect());
|
this.getCommand("resurrect").setExecutor(new CommandResurrect());
|
||||||
|
|
||||||
|
@ -97,37 +98,37 @@ public class Resurrection extends JavaPlugin implements Listener {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
// DO THIS
|
// DO THIS
|
||||||
PlayerData playerData = new PlayerData();
|
// PlayerData playerData = new PlayerData();
|
||||||
System.out.println("--- Reading Player data file ---");
|
// System.out.println("--- Reading Player data file ---");
|
||||||
playerData.readData();
|
// playerData.readData();
|
||||||
System.out.println(playerData.getPlayers());
|
// System.out.println(playerData.getPlayers());
|
||||||
System.out.println(playerData.getRawData());
|
// System.out.println(playerData.getRawData());
|
||||||
System.out.println("--- Oh look! A new player joined. Adding them. ---");
|
// System.out.println("--- Oh look! A new player joined. Adding them. ---");
|
||||||
String rawData = playerData.getRawData();
|
// String rawData = playerData.getRawData();
|
||||||
rawData = rawData + ";bryzinga,false,0";
|
// rawData = rawData + ";bryzinga,false,0";
|
||||||
playerData.saveData(rawData);
|
// playerData.saveData(rawData);
|
||||||
System.out.println(playerData.getPlayers());
|
// System.out.println(playerData.getPlayers());
|
||||||
System.out.println(playerData.getRawData());
|
// System.out.println(playerData.getRawData());
|
||||||
System.out.println("--- A player has died! Update the data file! ---");
|
// System.out.println("--- A player has died! Update the data file! ---");
|
||||||
rawData = playerData.getRawData();
|
// rawData = playerData.getRawData();
|
||||||
String[] rawPlayers = rawData.split(";");
|
// String[] rawPlayers = rawData.split(";");
|
||||||
String[] rawSinglePlayer = new String[3];
|
// String[] rawSinglePlayer = new String[3];
|
||||||
int index = 0;
|
// int index = 0;
|
||||||
for (String players : rawPlayers) {
|
// for (String players : rawPlayers) {
|
||||||
if (players.startsWith("bryzinga")) {
|
// if (players.startsWith("bryzinga")) {
|
||||||
String[] playerSplit = players.split(",");
|
// String[] playerSplit = players.split(",");
|
||||||
playerSplit[1] = "true";
|
// playerSplit[1] = "true";
|
||||||
playerSplit[2] = "12345";
|
// playerSplit[2] = "12345";
|
||||||
|
//
|
||||||
rawPlayers[index] = String.join(",", playerSplit);
|
// rawPlayers[index] = String.join(",", playerSplit);
|
||||||
break;
|
// break;
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
index++;
|
// index++;
|
||||||
}
|
// }
|
||||||
rawData = String.join(";", rawPlayers);
|
// rawData = String.join(";", rawPlayers);
|
||||||
playerData.saveData(rawData);
|
// playerData.saveData(rawData);
|
||||||
System.out.println(rawData);
|
// System.out.println(rawData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class PlayerData {
|
||||||
public void readData() {
|
public void readData() {
|
||||||
try {
|
try {
|
||||||
rawData = "";
|
rawData = "";
|
||||||
BufferedReader reader = new BufferedReader(new FileReader("data/playerData.resurrection"));
|
BufferedReader reader = new BufferedReader(new FileReader("playerData.resurrection"));
|
||||||
String line = "";
|
String line = "";
|
||||||
String[] playerData;
|
String[] playerData;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue