mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-02 06:28:52 +00:00
War data
- Added deleted
- Fixed join
- Added surrender
(cherry picked from commit ef070be338)
This commit is contained in:
1 parent
2e4285a630
commit
790ea96166
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user