SteamWar/SpigotCore
Archiviert
13
0

Is Punished #152

Zusammengeführt
YoyoNow hat 2 Commits von is_punished nach master 2021-12-30 20:15:04 +01:00 zusammengeführt

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;