More modernization for the database

This commit is contained in:
2026-05-19 02:30:16 -04:00
parent a980e26cc7
commit 64c691bb58
68 changed files with 588 additions and 456 deletions
@@ -13,21 +13,21 @@ import org.bukkit.Bukkit;
public class BanService extends AbstractService
{
public BanService()
public BanService(Plex plugin)
{
super(true, true);
super(plugin, true, true);
}
@Override
public void run(ScheduledTask task)
{
Plex.get().getPunishmentManager().getActiveBans().whenComplete((punishments, throwable) ->
plugin.getPunishmentManager().getActiveBans().whenComplete((punishments, throwable) ->
{
punishments.forEach(punishment ->
{
if (ZonedDateTime.now(ZoneId.of(TimeUtils.TIMEZONE)).isAfter(punishment.getEndDate()))
{
Plex.get().getPunishmentManager().unban(punishment);
plugin.getPunishmentManager().unban(punishment);
Bukkit.broadcast(PlexUtils.messageComponent("banExpiredBroadcast", Bukkit.getOfflinePlayer(punishment.getPunished()).getName()));
}
});