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:
sk89q
2014-04-27 23:34:39 -07:00
parent a5c3238876
commit c4c19017bb
17 changed files with 336 additions and 79 deletions

View File

@@ -22,11 +22,16 @@ package com.sk89q.worldedit.extent;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.operation.OperationQueue;
import com.sk89q.worldedit.util.Location;
import javax.annotation.Nullable;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -70,6 +75,17 @@ public abstract class AbstractDelegateExtent implements Extent {
return extent.setBlock(location, block);
}
@Override
@Nullable
public Entity createEntity(Location location, BaseEntity entity) {
return extent.createEntity(location, entity);
}
@Override
public List<Entity> getEntities() {
return extent.getEntities();
}
@Override
public Vector getMinimumPoint() {
return extent.getMinimumPoint();