fix oopsie

This commit is contained in:
Xander 2024-09-21 14:03:04 +02:00
parent df86f61828
commit 5c488dc8e1
No known key found for this signature in database
GPG key ID: 79979C7BA303E003

View file

@ -7,6 +7,7 @@ import org.bukkit.World;
import org.bukkit.persistence.PersistentDataType; import org.bukkit.persistence.PersistentDataType;
import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.Team;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.OptionalDouble; import java.util.OptionalDouble;
@ -26,14 +27,9 @@ public class EventRunner implements Runnable {
long lastRunDay = world.getPersistentDataContainer().get(eventKey, PersistentDataType.LONG); long lastRunDay = world.getPersistentDataContainer().get(eventKey, PersistentDataType.LONG);
day = Bukkit.getWorld("world").getFullTime() / 24000; day = Bukkit.getWorld("world").getFullTime() / 24000;
if (day > lastRunDay && !currentEvents.isEmpty()) { if (day > lastRunDay) {
for (Event event : currentEvents) { while (!currentEvents.isEmpty()) {
event.eventTimeEnded(); currentEvents.getFirst().eventTimeEnded();
}
// When event doesn't properly handle eventTimeEnded
for (Event event : currentEvents) {
event.eventFailed();
} }
} }