Reset timer when no players are online
This commit is contained in:
parent
009f8a6764
commit
76a1f2b1f0
@ -2,6 +2,8 @@ package mineplex.game.clans;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.MinecraftServer;
|
||||
|
@ -105,10 +105,17 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (_events.size() == 0 && System.currentTimeMillis() > _nextEventStart && UtilServer.getPlayers().length > 0)
|
||||
if (_events.size() == 0 && System.currentTimeMillis() > _nextEventStart)
|
||||
{
|
||||
Bukkit.broadcastMessage("Starting new event from random...");
|
||||
startRandomEvent();
|
||||
if (UtilServer.getPlayers().length > 0)
|
||||
{
|
||||
Bukkit.broadcastMessage("Starting new event from random...");
|
||||
startRandomEvent();
|
||||
}
|
||||
else
|
||||
{
|
||||
_nextEventStart = generateNextEventTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user