From ceacd7b6699c300e0d1a4f8bf488cf361d36fa97 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 22 Apr 2021 20:41:49 +0200 Subject: [PATCH] Update Upstream 95d784f Return false if Entity#remove is unsupported --- .../main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index b5451081d..368e16cf2 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -113,7 +113,11 @@ public class BukkitEntity implements Entity { public boolean remove() { org.bukkit.entity.Entity entity = entityRef.get(); if (entity != null) { - entity.remove(); + try { + entity.remove(); + } catch (UnsupportedOperationException e) { + return false; + } return entity.isDead(); } else { return true;