Is Punished #152
@ -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;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren