This commit is contained in:
Jesse Boyd 2017-08-10 17:15:03 +10:00
parent c9cee8a4a8
commit af99c6a706
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -245,17 +245,18 @@ public abstract class HybridUtils {
} }
} }
if (!chunks.isEmpty()) { if (!chunks.isEmpty()) {
while (System.currentTimeMillis() < 10 && !chunks.isEmpty()) {
Iterator<ChunkLoc> iterator = chunks.iterator();
final ChunkLoc chunk = iterator.next();
iterator.remove();
TaskManager.IMP.sync(new RunnableVal<Object>() { TaskManager.IMP.sync(new RunnableVal<Object>() {
@Override @Override
public void run(Object value) { public void run(Object value) {
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < 20 && !chunks.isEmpty()) {
Iterator<ChunkLoc> iterator = chunks.iterator();
final ChunkLoc chunk = iterator.next();
iterator.remove();
regenerateRoad(area, chunk, extend); regenerateRoad(area, chunk, extend);
} }
});
} }
});
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();