Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
d9fc0a5a2f
Commit
cff70e70c2
@ -27,6 +27,7 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Punishment {
|
public class Punishment {
|
||||||
|
|
||||||
@ -50,6 +51,16 @@ public class Punishment {
|
|||||||
}, user);
|
}, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isPunished(SteamwarUser user, Punishment.PunishmentType type, Consumer<Punishment> callback) {
|
||||||
|
Punishment punishment = Punishment.getPunishmentOfPlayer(user.getId(), type);
|
||||||
|
if(punishment == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
callback.accept(punishment);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final Timestamp startTime;
|
private final Timestamp startTime;
|
||||||
private Timestamp endTime;
|
private Timestamp endTime;
|
||||||
private final PunishmentType type;
|
private final PunishmentType type;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren