From 420c45a29ac8a2cdd0110e9a9b225abf9e726a26 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 16 Jul 2021 18:48:21 +0100 Subject: [PATCH] Entity removal should be on the main thread as we're just passing through rather than doing chunk operations - Fixes #1164 - Not working: butcher/remove history --- .../java/com/sk89q/worldedit/command/UtilityCommands.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index ea189bf05..fe96fda10 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -25,6 +25,7 @@ import com.fastasyncworldedit.core.configuration.Settings; import com.fastasyncworldedit.core.object.DelegateConsumer; import com.fastasyncworldedit.core.object.function.QuadFunction; import com.fastasyncworldedit.core.util.MainUtil; +import com.fastasyncworldedit.core.util.TaskManager; import com.fastasyncworldedit.core.util.image.ImageUtil; import com.google.common.base.Function; import com.sk89q.worldedit.EditSession; @@ -636,7 +637,8 @@ public class UtilityCommands { flags.or(CreatureButcher.Flags.ARMOR_STAND, killArmorStands, "worldedit.butcher.armorstands"); flags.or(CreatureButcher.Flags.WATER, killWater, "worldedit.butcher.water"); - int killed = killMatchingEntities(radius, actor, flags::createFunction); + int finalRadius = radius; + int killed = TaskManager.IMP.sync(() -> killMatchingEntities(finalRadius, actor, flags::createFunction)); actor.print(Caption.of( "worldedit.butcher.killed", @@ -664,7 +666,7 @@ public class UtilityCommands { return 0; } - int removed = killMatchingEntities(radius, actor, remover::createFunction); + int removed = TaskManager.IMP.sync(() -> killMatchingEntities(radius, actor, remover::createFunction)); actor.print(Caption.of("worldedit.remove.removed", TextComponent.of(removed))); return removed; }