implement entities in paste -e

This commit is contained in:
Aurora
2020-07-03 19:52:55 +02:00
parent 34298f7dee
commit 94b1233d98
5 changed files with 59 additions and 27 deletions

View File

@ -119,31 +119,6 @@ public class BukkitWorld extends AbstractWorld {
return list;
}
@Nullable
@Override
public com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
try {
Entity createdEntity = adapter.createEntity(BukkitAdapter.adapt(getWorld(), location), entity);
if (createdEntity != null) {
return new BukkitEntity(createdEntity);
} else {
return null;
}
} catch (Exception e) {
logger.warn("Corrupt entity found when creating: " + entity.getType().getId());
if (entity.getNbtData() != null) {
logger.warn(entity.getNbtData().toString());
}
e.printStackTrace();
return null;
}
} else {
return null;
}
}
/**
* Get the world handle.
*