Archiviert
1
0

Add some basic punishment stuff

Dieser Commit ist enthalten in:
yoyosource 2022-11-21 17:28:08 +01:00
Ursprung ef11620e2f
Commit f463c99eec
2 geänderte Dateien mit 22 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -41,10 +41,7 @@ import net.md_5.bungee.api.event.ServerConnectEvent;
import java.net.*; import java.net.*;
import java.time.Instant; import java.time.Instant;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static de.steamwar.bungeecore.Storage.teamInvitations; import static de.steamwar.bungeecore.Storage.teamInvitations;
@ -242,7 +239,15 @@ public class TeamCommand extends BasicCommand {
user.setTeam(t); user.setTeam(t);
teamInvitations.remove(user.getId()); teamInvitations.remove(user.getId());
Message.send("TEAM_JOIN_JOINED", player, Team.get(t).getTeamName()); Team team = Team.get(t);
Message.send("TEAM_JOIN_JOINED", player, team.getTeamName());
if (Punishment.getPunishmentOfPlayer(user.getId(), Punishment.PunishmentType.NoEvent) != null) {
Event.getComing().forEach(event -> {
if (TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())) {
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
}
});
}
} }
private void stepBack(ProxiedPlayer player, SteamwarUser user, Team team) { private void stepBack(ProxiedPlayer player, SteamwarUser user, Team team) {
@ -299,6 +304,10 @@ public class TeamCommand extends BasicCommand {
return; return;
} }
if (Punishment.getPunishmentOfPlayer(target.getId(), Punishment.PunishmentType.NoEvent) != null) {
// TODO: Add warning message
}
if(!teamInvitations.containsKey(target.getId())) if(!teamInvitations.containsKey(target.getId()))
teamInvitations.put(target.getId(), new LinkedList<>()); teamInvitations.put(target.getId(), new LinkedList<>());
@ -553,6 +562,13 @@ public class TeamCommand extends BasicCommand {
return; return;
} }
boolean hasPunishedPlayer = team.getMembers().stream()
.map(id -> Punishment.getPunishmentOfPlayer(id, Punishment.PunishmentType.NoEvent))
.anyMatch(Objects::nonNull);
if (hasPunishedPlayer) {
// TODO: Add message
}
if(TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())){ if(TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())){
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID()); TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
Message.send("TEAM_EVENT_LEFT", player); Message.send("TEAM_EVENT_LEFT", player);

Datei anzeigen

@ -144,6 +144,7 @@ public class Punishment {
NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", "UNNOSCHEMSUBMITTING_ERROR", "UNNOSCHEMSUBMITTING"), NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", "UNNOSCHEMSUBMITTING_ERROR", "UNNOSCHEMSUBMITTING"),
NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"), NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"),
NoFightServer(false, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", "UNNOFIGHTSERVER_ERROR", "UNNOFIGHTSERVER"), NoFightServer(false, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", "UNNOFIGHTSERVER_ERROR", "UNNOFIGHTSERVER"),
NoEvent(true, "", "", "", "", ""),
NoTeamServer(true, "NOTEAMSERVER_TEAM", "NOTEAMSERVER_PERMA", "NOTEAMSERVER_UNTIL", "UNNOTEAMSERVER_ERROR", "UNNOTEAMSERVER"), NoTeamServer(true, "NOTEAMSERVER_TEAM", "NOTEAMSERVER_PERMA", "NOTEAMSERVER_UNTIL", "UNNOTEAMSERVER_ERROR", "UNNOTEAMSERVER"),
Note(false, "NOTE_TEAM", null, null, null, null, true), Note(false, "NOTE_TEAM", null, null, null, null, true),
; ;