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

@ -24,7 +24,6 @@ import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.fastasyncworldedit.core.util.TaskManager;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag;
@ -334,9 +333,7 @@ public class BukkitWorld extends AbstractWorld {
@Override
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt) {
//FAWE start - allow tree commands to be undone and obey region restrictions
return TaskManager.taskManager().sync(() -> WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt,
getWorld()
));
return WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt, getWorld());
//FAWE end
}