SteamWar/BungeeCore
Archiviert
13
2

Hotfix build
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-07-18 22:11:19 +02:00
Ursprung 6192d0d458
Commit df3e082774

Datei anzeigen

@ -177,7 +177,6 @@ public class TeamCommand extends SWCommand {
} }
user.setTeam(t); user.setTeam(t);
if (user.isPunished(Punishment.PunishmentType.NoTeamEventParticipation)) removeTeamTeilnahme(t);
teamInvitations.remove(user.getId()); teamInvitations.remove(user.getId());
Message.send("TEAM_JOIN_JOINED", player, Team.get(t).getTeamName()); Message.send("TEAM_JOIN_JOINED", player, Team.get(t).getTeamName());
} }
@ -248,10 +247,6 @@ public class TeamCommand extends SWCommand {
return; return;
} }
if (target.isPunished(Punishment.PunishmentType.NoTeamEventParticipation)) {
Message.send("UNNOTEAMEVENTPARTICIPATION_NOTICE", player);
}
teamInvitations.get(target.getId()).add(team.getTeamId()); teamInvitations.get(target.getId()).add(team.getTeamId());
Message.send("TEAM_INVITE_INVITED", player, toInvite); Message.send("TEAM_INVITE_INVITED", player, toInvite);
@ -487,10 +482,6 @@ public class TeamCommand extends SWCommand {
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID()); TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
Message.send("TEAM_EVENT_LEFT", player); Message.send("TEAM_EVENT_LEFT", player);
}else{ }else{
if (checkNoEventPunished(team.getTeamId())) {
Message.send("UNNOTEAMEVENTPARTICIPATION_MESSAGE", player);
return;
}
TeamTeilnahme.teilnehmen(team.getTeamId(), event.getEventID()); TeamTeilnahme.teilnehmen(team.getTeamId(), event.getEventID());
Message.send("TEAM_EVENT_JOINED", player, event.getEventName()); Message.send("TEAM_EVENT_JOINED", player, event.getEventName());
Message.sendPrefixless("TEAM_EVENT_HOW_TO_LEAVE", player); Message.sendPrefixless("TEAM_EVENT_HOW_TO_LEAVE", player);
@ -695,16 +686,4 @@ public class TeamCommand extends SWCommand {
} }
return false; return false;
} }
public static void removeTeamTeilnahme(int team) {
Event.getComing()
.stream()
.filter(event -> TeamTeilnahme.nimmtTeil(team, event.getEventID()))
.forEach(event -> TeamTeilnahme.notTeilnehmen(team, event.getEventID()));
}
public static boolean checkNoEventPunished(int team) {
return SteamwarUser.getTeam(team).stream()
.anyMatch(steamwarUser -> steamwarUser.isPunished(Punishment.PunishmentType.NoTeamEventParticipation));
}
} }