From e90b26119642581437aa0a5e75a733c53894b4b6 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 7 Aug 2021 16:19:41 +0100 Subject: [PATCH] Trees should be generated on the main thread - Also remove warning when using tree tool --- .../src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 4 +++- .../main/java/com/sk89q/worldedit/command/ToolCommands.java | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index d81f0ee4b..a31439874 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -23,6 +23,7 @@ import com.fastasyncworldedit.bukkit.util.WorldUnloadedException; import com.fastasyncworldedit.core.Fawe; 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; @@ -329,7 +330,8 @@ public class BukkitWorld extends AbstractWorld { @Override public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt) { - return WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt, getWorld()); + return TaskManager.IMP.sync(() -> WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt, + getWorld())); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index c6af83b07..416e1a00a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -242,9 +242,6 @@ public class ToolCommands { TreeGenerator.TreeType type ) throws WorldEditException { setTool(player, session, new TreePlanter(type), "worldedit.tool.tree.equip"); - //FAWE start - player.print(TextComponent.of("Warning: This brush is currently not undo-able due to a Spigot bug!").color(TextColor.RED)); - //FAWE end } @Command(