From af99c6a706bebba633e8604e13ff1850eb040334 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 10 Aug 2017 17:15:03 +1000 Subject: [PATCH] * --- .../plot/generator/HybridUtils.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridUtils.java b/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridUtils.java index 7b48e93d7..aa1ccabdd 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridUtils.java @@ -245,17 +245,18 @@ public abstract class HybridUtils { } } if (!chunks.isEmpty()) { - while (System.currentTimeMillis() < 10 && !chunks.isEmpty()) { - Iterator iterator = chunks.iterator(); - final ChunkLoc chunk = iterator.next(); - iterator.remove(); - TaskManager.IMP.sync(new RunnableVal() { - @Override - public void run(Object value) { + TaskManager.IMP.sync(new RunnableVal() { + @Override + public void run(Object value) { + long start = System.currentTimeMillis(); + while (System.currentTimeMillis() - start < 20 && !chunks.isEmpty()) { + Iterator iterator = chunks.iterator(); + final ChunkLoc chunk = iterator.next(); + iterator.remove(); regenerateRoad(area, chunk, extend); } - }); - } + } + }); } } catch (Exception e) { e.printStackTrace();