SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Is Punished' (#152) from is_punished into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #152
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
YoyoNow 2021-12-30 20:15:03 +01:00
Commit 9c3427a1ac

Datei anzeigen

@ -27,6 +27,7 @@ import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Consumer;
public class Punishment {
@ -50,6 +51,16 @@ public class Punishment {
}, user);
}
public static boolean isPunished(SteamwarUser user, Punishment.PunishmentType type, Consumer<Punishment> callback) {
Punishment punishment = Punishment.getPunishmentOfPlayer(user.getId(), type);
if(punishment == null || punishment.isCurrent()) {
return false;
} else {
callback.accept(punishment);
return true;
}
}
private final Timestamp startTime;
private Timestamp endTime;
private final PunishmentType type;