Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.zithium.tournaments.action;

import me.clip.placeholderapi.PlaceholderAPI;
import net.zithium.tournaments.XLTournamentsPlugin;
import net.zithium.tournaments.action.actions.*;
import net.zithium.tournaments.tournament.Tournament;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void executeActions(Player player, List<String> items, Tournament tournam
item = item.contains(" ") ? item.split(" ", 2)[1] : "";
if (player != null) {
item = item.replace("{PLAYER}", player.getName());
item = PlaceholderAPI.setPlaceholders(player, item);

if(tournament != null) {
item = TextUtil.setPlaceholders(item, player.getUniqueId(), tournament);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void updatePlaceholders() {
try {
value = Integer.parseInt(PlaceholderAPI.setPlaceholders((OfflinePlayer) player, "%" + tournament.getMeta("PLACEHOLDER") + "%"));
} catch (Exception ex) {
JAVA_PLUGIN.getLogger().warning("Couldn't convert placeholder value to valid number; %"+tournament.getMeta("PLACEHOLDER")+"% returned an invalid number for user "+player.getName());
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ public void loadPlayerCache(Player player) {
List<String> actions = new ArrayList<>(handler.getPlayerQueueActions(uuid.toString()));
if (!actions.isEmpty()) {
plugin.getStorageManager().getStorageHandler().removeQueueActions(uuid.toString());
Bukkit.getScheduler().runTask(plugin, () -> plugin.getActionManager().executeActions(player, actions));
Bukkit.getScheduler().runTaskLater(plugin, () -> {
plugin.getActionManager().executeActions(player, actions);
}, 60L);
}

for (Tournament tournament : getTournaments()) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/zithium/tournaments/utility/TimeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ public static ZonedDateTime getStartTime(Timeline timeline, ZoneId zoneId) {
switch (timeline) {
case WEEKLY:
time = ZonedDateTime.of(LocalDateTime.of(time.with(DayOfWeek.MONDAY).toLocalDate(),
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId);
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId).plusMinutes(2);
break;
case MONTHLY:
time = ZonedDateTime.of(LocalDateTime.of(time.with(TemporalAdjusters.firstDayOfMonth()).toLocalDate(),
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId);
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId).plusMinutes(2);
break;
case DAILY:
time = ZonedDateTime.of(LocalDateTime.of(time.toLocalDate(),
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId);
time.toLocalDate().atStartOfDay().toLocalTime()), zoneId).plusMinutes(2);
break;
case HOURLY:
time = time.withMinute(0).withSecond(0).withNano(0);
Expand Down