Only synchronise tree generation at the very lowest level (#1788)

* Only synchronise tree generation at the very lowest level
 - Fixes #1681

* Perform the generate inside try-finally and actually use the resultant copied map to place blocks to the editsession

* Check result of generateTree and return null if failed
This commit is contained in:
Jordan
2022-06-13 08:05:18 +01:00
committed by GitHub
parent 02a6bb9b27
commit 63f031b01a
7 changed files with 85 additions and 66 deletions

View File

@ -77,7 +77,7 @@ public class FaweAPI {
* </p>
*
* @param world The name of the world
* @param autoQueue If it should start dispatching before you enqueue it.
* @param autoQueue If it should start dispatching before you close/flush it.
* @return the queue extent
*/
public static IQueueExtent<IQueueChunk> createQueue(World world, boolean autoQueue) {

View File

@ -273,13 +273,11 @@ public class WorldWrapper extends AbstractWorld {
@Override
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 position) throws
MaxChangedBlocksException {
return TaskManager.taskManager().sync(() -> {
try {
return parent.generateTree(type, editSession, position);
} catch (MaxChangedBlocksException e) {
throw new RuntimeException(e);
}
});
try {
return parent.generateTree(type, editSession, position);
} catch (MaxChangedBlocksException e) {
throw new RuntimeException(e);
}
}
@Override