geforkt von SteamWar/BungeeCore
Fix disbanding teams
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
bac1e3eaee
Commit
5715ea391c
@ -248,14 +248,15 @@ public class TeamCommand extends BasicCommand {
|
|||||||
if(notInTeam(player, user))
|
if(notInTeam(player, user))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(team.size() > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
|
int teamSize = team.size();
|
||||||
|
if(teamSize > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
|
||||||
Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
|
Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.setTeam(0);
|
user.setTeam(0);
|
||||||
|
|
||||||
if(user.isLeader() && team.size() > 0){
|
if(teamSize == 1){
|
||||||
team.disband(user);
|
team.disband(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren