From 6fc68da2ce3b920fa137783276bf7769a29a26f0 Mon Sep 17 00:00:00 2001 From: Aurora Date: Wed, 1 Jul 2020 14:52:50 +0200 Subject: [PATCH] Revert "got paste -e working, still throws IllegalStateException but idc" This reverts commit 54008be1a2440c54583150d96deeb1eb70de4813. --- .../com/sk89q/worldedit/bukkit/BukkitWorld.java | 13 +------------ .../bukkit/adapter/IDelegateBukkitImplAdapter.java | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index b40256059..2fe53dd30 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -61,7 +61,6 @@ import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.Chest; -import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; import org.bukkit.entity.Entity; import org.bukkit.inventory.DoubleChestInventory; import org.bukkit.inventory.Inventory; @@ -123,7 +122,7 @@ public class BukkitWorld extends AbstractWorld { @Override public com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); - if (adapter != null && Fawe.isMainThread()) { + if (adapter != null) { try { Entity createdEntity = adapter.createEntity(BukkitAdapter.adapt(getWorld(), location), entity); if (createdEntity != null) { @@ -139,16 +138,6 @@ public class BukkitWorld extends AbstractWorld { e.printStackTrace(); return null; } - } else if (adapter != null && !Fawe.isMainThread()){ - Future future = Fawe.get().getQueueHandler().sync((Supplier)() -> this.createEntity(location, entity)); - while (!future.isDone()) { - ((CraftWorld)worldRef.get()).getHandle().getChunkProvider().runTasks(); - } - try { - return future.get(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } } else { return null; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java index 4d7dc9740..5bf4d88af 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java @@ -77,7 +77,7 @@ public interface IDelegateBukkitImplAdapter extends BukkitImplAdapter { default Entity createEntity(Location location, BaseEntity state) { return getParent().createEntity(location, state); } - + @Override default Map> getProperties(BlockType blockType) { return getParent().getProperties(blockType);