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