This commit is contained in:
Jesse Boyd
2019-08-07 01:29:49 +10:00
parent a3c58a187e
commit a476ab1ea0
27 changed files with 461 additions and 485 deletions

View File

@ -19,11 +19,10 @@
package com.sk89q.worldedit.entity;
import com.sk89q.worldedit.extension.platform.Locatable;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.util.Faceted;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.entity.EntityType;
import javax.annotation.Nullable;
/**
@ -34,7 +33,7 @@ import javax.annotation.Nullable;
* instance of an entity, but a {@link BaseEntity} can be created from
* this entity by calling {@link #getState()}.</p>
*/
public interface Entity extends Faceted {
public interface Entity extends Faceted, Locatable {
/**
* Get a copy of the entity's state.
@ -48,33 +47,11 @@ public interface Entity extends Faceted {
@Nullable
BaseEntity getState();
/**
* Get the location of this entity.
*
* @return the location of the entity
*/
Location getLocation();
/**
* Sets the location of this entity.
*
* @param location the new location of the entity
* @return if the teleport worked
*/
boolean setLocation(Location location);
default EntityType getType() {
BaseEntity state = getState();
return state != null ? state.getType() : null;
}
/**
* Get the extent that this entity is on.
*
* @return the extent
*/
Extent getExtent();
/**
* Remove this entity from it container.
*

View File

@ -191,8 +191,12 @@ public interface Player extends Entity, Actor {
* Get the point of the block that is being stood in.
*
* @return point
* @deprecated Use Locatable#getBlockLocation
*/
Location getBlockIn();
@Deprecated
default Location getBlockIn() {
return getBlockLocation();
}
/**
* Get the point of the block that is being stood upon.