[O] Use timeout for updateCache

This commit is contained in:
Hykilpikonna
2020-02-19 20:53:56 -05:00
parent c268e0523f
commit a776cabb24
@@ -96,11 +96,16 @@ public class SeedServerCache extends Behavior
new Thread(this::loadChunks).start();
}
}
// Update cache
if (cacheLocation == null)
else
{
new Thread(this::updateCache).start();
// Update cache every 5 seconds (5 * 20 = 100 ticks)
ticks ++;
if (ticks > 100)
{
ticks = 0;
new Thread(this::updateCache).start();
}
}
}