Adjustments for previous commit.

This commit is contained in:
MobiusDevelopment
2019-06-08 00:48:03 +00:00
parent 6de4ae247c
commit f07e87d3df
14 changed files with 98 additions and 84 deletions

View File

@ -40,19 +40,20 @@ public class RespawnTaskManager
for (Entry<Spawn, List<Long>> entry : PENDING_RESPAWNS.entrySet())
{
final Spawn spawn = entry.getKey();
for (Long respawnTime : entry.getValue())
final List<Long> schedules = entry.getValue();
for (Long respawnTime : schedules)
{
if (time > respawnTime)
{
entry.getValue().remove(respawnTime);
schedules.remove(respawnTime);
if (schedules.isEmpty())
{
PENDING_RESPAWNS.remove(spawn);
}
spawn.doSpawn();
spawn._scheduledCount--;
}
}
if (entry.getValue().isEmpty())
{
PENDING_RESPAWNS.remove(spawn);
}
}
}, 0, 1000);
}