Sync regen to the calling thread

This commit is contained in:
Jesse Boyd 2016-06-17 15:26:18 +10:00
parent 9bf2d2b0c3
commit 97a0126fd1

View File

@ -243,7 +243,8 @@ public class WorldWrapper extends AbstractWorld {
session.setChangeSet(fcs); session.setChangeSet(fcs);
final boolean cuboid = region instanceof CuboidRegion; final boolean cuboid = region instanceof CuboidRegion;
Set<Vector2D> chunks = region.getChunks(); Set<Vector2D> chunks = region.getChunks();
TaskManager.IMP.objectTask(chunks, new RunnableVal<Vector2D>() { for (Vector2D chunk : chunks) {
RunnableVal<Vector2D> r = new RunnableVal<Vector2D>() {
@Override @Override
public void run(Vector2D chunk) { public void run(Vector2D chunk) {
int cx = chunk.getBlockX(); int cx = chunk.getBlockX();
@ -324,12 +325,11 @@ public class WorldWrapper extends AbstractWorld {
} }
queue.regenerateChunk(cx, cz); queue.regenerateChunk(cx, cz);
} }
}, new Runnable() { };
@Override r.value = chunk;
public void run() { TaskManager.IMP.sync(r);
queue.enqueue();
} }
}); session.flushQueue();
return false; return false;
} }