From 34298f7dee517d5fa786390ea61d451d6beb3568 Mon Sep 17 00:00:00 2001 From: Aurora Date: Wed, 1 Jul 2020 19:28:38 +0200 Subject: [PATCH] Add back the getEntity Stuff since it seems to work fine --- .../main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java | 2 +- .../boydti/fawe/object/clipboard/WorldCopyClipboard.java | 4 ++++ .../src/main/java/com/sk89q/worldedit/EditSession.java | 6 ++++++ .../worldedit/function/operation/ForwardExtentCopy.java | 5 +++-- 4 files changed, 14 insertions(+), 3 deletions(-) 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 d21ddcd4c..be50815f3 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 @@ -89,7 +89,7 @@ public class BukkitEntity implements Entity { @Override public com.sk89q.worldedit.world.entity.EntityType getType() { - return EntityTypes.get(type.getName().toUpperCase(Locale.ROOT)); + return EntityTypes.get(type.getName().toLowerCase(Locale.ROOT)); } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java index 054ecae3e..7f6912b10 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/WorldCopyClipboard.java @@ -63,4 +63,8 @@ public class WorldCopyClipboard extends ReadOnlyClipboard { return hasBiomes; } + @Override + public List getEntities(Region region) { + return getExtent().getEntities(region); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index e3e38757c..ccfaa0ccc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -46,6 +46,7 @@ import com.boydti.fawe.util.ExtentTraverser; import com.boydti.fawe.util.MaskTraverser; import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.TaskManager; +import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -3054,4 +3055,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { } return false; } + + @Override + public List getEntities(Region region) { + return world.getEntities(region); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index cedfee026..e12921516 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -406,6 +406,7 @@ public class ForwardExtentCopy implements Operation { }); EntityVisitor entityVisitor = new EntityVisitor(entities.iterator(), entityCopy); Operations.completeBlindly(entityVisitor); + affectedEntities += entityVisitor.getAffected(); } if (transExt != null) { @@ -427,8 +428,8 @@ public class ForwardExtentCopy implements Operation { return ImmutableList.of( TranslatableComponent.of("worldedit.operation.affected.block", TextComponent.of(affectedBlocks)).color(TextColor.LIGHT_PURPLE), - TranslatableComponent.of("worldedit.operation.affected.biome", - TextComponent.of(affectedBiomeCols)).color(TextColor.LIGHT_PURPLE), +// TranslatableComponent.of("worldedit.operation.affected.biome", +// TextComponent.of(affectedBiomeCols)).color(TextColor.LIGHT_PURPLE), TranslatableComponent.of("worldedit.operation.affected.entity", TextComponent.of(affectedEntities)).color(TextColor.LIGHT_PURPLE) );