From 1097ac78898b39b55d02e036008cad8b1966e021 Mon Sep 17 00:00:00 2001 From: wea_ondara Date: Mon, 3 Aug 2020 17:35:53 +0200 Subject: [PATCH] remove entity properly --- .../sk89q/worldedit/function/entity/ExtentEntityCopy.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java index 04d179bdf..4ed4a6bc9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java @@ -155,9 +155,10 @@ public class ExtentEntityCopy implements EntityFunction { uuid = new UUID(tag.getLong("PersistentIDMSB"), tag.getLong("PersistentIDLSB")); } if (uuid != null) { - Extent src = source != null ? source : entity.getExtent(); - if (src != null) { - src.removeEntity(entity.getLocation().getBlockX(), entity.getLocation().getBlockY(), entity.getLocation().getBlockZ(), uuid); + if (source != null) { + source.removeEntity(entity.getLocation().getBlockX(), entity.getLocation().getBlockY(), entity.getLocation().getBlockZ(), uuid); + } else { + entity.remove(); } } }