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()) { TaskManager.IMP.sync(new RunnableVal<Object>() {
Iterator<ChunkLoc> iterator = chunks.iterator(); @Override
final ChunkLoc chunk = iterator.next(); public void run(Object value) {
iterator.remove(); long start = System.currentTimeMillis();
TaskManager.IMP.sync(new RunnableVal<Object>() { while (System.currentTimeMillis() - start < 20 && !chunks.isEmpty()) {
@Override Iterator<ChunkLoc> iterator = chunks.iterator();
public void run(Object value) { 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();