SteamWar/BungeeCore
Archiviert
13
2

Commits vergleichen

...
Dieses Repository wurde am 2024-08-05 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.

1 Commits

Autor SHA1 Nachricht Datum
yoyosource
f463c99eec Add some basic punishment stuff 2022-11-21 17:28:08 +01:00
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.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static de.steamwar.bungeecore.Storage.teamInvitations;
@ -242,7 +239,15 @@ public class TeamCommand extends BasicCommand {
user.setTeam(t);
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) {
@ -299,6 +304,10 @@ public class TeamCommand extends BasicCommand {
return;
}
if (Punishment.getPunishmentOfPlayer(target.getId(), Punishment.PunishmentType.NoEvent) != null) {
// TODO: Add warning message
}
if(!teamInvitations.containsKey(target.getId()))
teamInvitations.put(target.getId(), new LinkedList<>());
@ -553,6 +562,13 @@ public class TeamCommand extends BasicCommand {
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())){
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
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"),
NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"),
NoFightServer(false, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", "UNNOFIGHTSERVER_ERROR", "UNNOFIGHTSERVER"),
NoEvent(true, "", "", "", "", ""),
NoTeamServer(true, "NOTEAMSERVER_TEAM", "NOTEAMSERVER_PERMA", "NOTEAMSERVER_UNTIL", "UNNOTEAMSERVER_ERROR", "UNNOTEAMSERVER"),
Note(false, "NOTE_TEAM", null, null, null, null, true),
;