Added incomplete entity support to all Extents.
The Bukkit implementation supports the new entity API, but it has not yet been tested. The Forge implementation does not support the entity API yet. At the moment, an UnsupportedOperationException is thrown for Entity.getState() in some implementations, but use of an exception should probably not be allowed. BaseEntity is now an interface. It should not be possible to create instances of BaseEntity because it may be implementation-specific.
This commit is contained in:
@@ -32,6 +32,7 @@ import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.mapping.Resolver;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
@@ -339,6 +340,17 @@ public class LocalWorldAdapter extends LocalWorld {
|
||||
return world.getMetaData(entity, metaDataClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) {
|
||||
return world.createEntity(location, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities() {
|
||||
return world.getEntities();
|
||||
}
|
||||
|
||||
public static LocalWorldAdapter wrap(World world) {
|
||||
return new LocalWorldAdapter(world);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user