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