Add time_active placeholders

- %plan_time_active_day%
- %plan_time_active_day_raw%
- %plan_time_active_week%
- %plan_time_active_week_raw%
- %plan_time_active_month%
- %plan_time_active_month_raw%

Affects issues:
- Close #2721
This commit is contained in:
Aurora Lahtela 2022-11-13 14:47:31 +02:00
parent 38774867f7
commit f41796f079

View File

@ -256,6 +256,39 @@ public class PlayerPlaceHolders implements Placeholders {
.toActivePlaytime()
);
placeholders.register("player_time_active_day",
player -> time.apply(SessionsMutator.forContainer(player)
.filterSessionsBetween(dayAgo(), now())
.toActivePlaytime())
);
placeholders.register("player_time_active_day_raw",
player -> SessionsMutator.forContainer(player)
.filterSessionsBetween(dayAgo(), now())
.toActivePlaytime()
);
placeholders.register("player_time_active_week",
player -> time.apply(SessionsMutator.forContainer(player)
.filterSessionsBetween(weekAgo(), now())
.toActivePlaytime())
);
placeholders.register("player_time_active_week_raw",
player -> SessionsMutator.forContainer(player)
.filterSessionsBetween(weekAgo(), now())
.toActivePlaytime()
);
placeholders.register("player_time_active_month",
player -> time.apply(SessionsMutator.forContainer(player)
.filterSessionsBetween(monthAgo(), now())
.toActivePlaytime())
);
placeholders.register("player_time_active_month_raw",
player -> SessionsMutator.forContainer(player)
.filterSessionsBetween(monthAgo(), now())
.toActivePlaytime()
);
placeholders.register("player_time_afk",
player -> time.apply(SessionsMutator.forContainer(player)
.toAfkTime())