- Added deleted
- Fixed join
- Added surrender
This commit is contained in:
Isaac committed 2023-04-08 02:48:55 +01:00
1 parent 26cd6d04f8
commit ef070be338
3 files changed
+132 -18

No files matched your search

@@ -60,6 +60,11 @@ public class WarData
wars.add(war);
}
public static void removeWar(War war) {
wars.remove(war);
deleteWar(war);
}
/**
* Gets the wars currently saved in files as an ArrayList of War Objects
* @return War Object ArrayList
@@ -118,5 +123,15 @@ public class WarData
DataManager.saveData("wars" + File.separator + war.getName() + ".yml", sHashMap);
}
private static void deleteWar(War war) {
File[] files = new File(dataFolderPath + File.separator + "wars").listFiles(ymlFilter);
for (File file : files) {
if (file.getName().startsWith(war.getName())) {
file.delete();
}
}
}
}