fix oopsie
This commit is contained in:
parent
df86f61828
commit
5c488dc8e1
1 changed files with 4 additions and 8 deletions
|
@ -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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue