Revert "got paste -e working, still throws IllegalStateException but idc"

This reverts commit 54008be1a2.
This commit is contained in:
Aurora 2020-07-01 14:52:50 +02:00
parent b96d45e4e6
commit 6fc68da2ce
No known key found for this signature in database
GPG Key ID: 89839F67B53656AD
2 changed files with 2 additions and 13 deletions

View File

@ -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<com.sk89q.worldedit.entity.Entity> future = Fawe.get().getQueueHandler().sync((Supplier<com.sk89q.worldedit.entity.Entity>)() -> 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;
}

View File

@ -77,7 +77,7 @@ public interface IDelegateBukkitImplAdapter<T> extends BukkitImplAdapter<T> {
default Entity createEntity(Location location, BaseEntity state) {
return getParent().createEntity(location, state);
}
@Override
default Map<String, ? extends Property<?>> getProperties(BlockType blockType) {
return getParent().getProperties(blockType);