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
This commit is contained in:
dordsor21 2021-07-16 18:48:21 +01:00
parent 4d4db7dcd0
commit 420c45a29a
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -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;
}