SHOW:
|
|
- or go back to the newest paste.
| 1 | public Team create(String teamName, String leaderName){
| |
| 2 | ||
| 3 | this.teamName = teamName; | |
| 4 | ||
| 5 | loadTeamFile(); | |
| 6 | ||
| 7 | int teamID = 1; | |
| 8 | ||
| 9 | - | for (@SuppressWarnings("unused") String keyString : FileManager.getConfig("teams.yml").getKeys(false)){
|
| 9 | + | for (@SuppressWarnings("unused") String key : teamYaml.getKeys(false)){
|
| 10 | teamID++; | |
| 11 | } | |
| 12 | ||
| 13 | this.teamID = teamID; | |
| 14 | ||
| 15 | teamYaml.set(this.teamID + ".name", this.teamName); | |
| 16 | - | teamYaml.set(this.teamID + ".tag", 0); |
| 16 | + | |
| 17 | teamYaml.set(this.teamID + ".rank", 0); | |
| 18 | ||
| 19 | List<String> memberList = Arrays.asList(leaderName); | |
| 20 | teamYaml.set(this.teamID + ".members", memberList); | |
| 21 | ||
| 22 | saveTeamFile(); | |
| 23 | ||
| 24 | loadPlayerFile(); | |
| 25 | ||
| 26 | playerYaml.set(leaderName, this.teamID); | |
| 27 | ||
| 28 | savePlayerFile(); | |
| 29 | ||
| 30 | teamMap.put(this.teamID, this.teamName); | |
| 31 | ||
| 32 | return this; | |
| 33 | ||
| 34 | } |