mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-17 13:51:30 +01:00
Sync regen to the calling thread
This commit is contained in:
parent
9bf2d2b0c3
commit
97a0126fd1
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user