Added a method to teleport entities across worlds.

This commit is contained in:
Matthew Miller
2018-12-21 16:56:10 +10:00
committed by IronApollo
parent 7a9bd226ce
commit c935e381b7
14 changed files with 287 additions and 2 deletions

View File

@ -71,6 +71,16 @@ public class BukkitEntity implements Entity {
}
}
@Override
public boolean setLocation(Location location) {
org.bukkit.entity.Entity entity = entityRef.get();
if (entity != null) {
return entity.teleport(BukkitAdapter.adapt(location));
} else {
return false;
}
}
@Override
public BaseEntity getState() {
org.bukkit.entity.Entity entity = entityRef.get();

View File

@ -236,6 +236,11 @@ public class BukkitPlayer extends AbstractPlayerActor {
nativeLocation.getPitch());
}
@Override
public boolean setLocation(com.sk89q.worldedit.util.Location location) {
return player.teleport(BukkitAdapter.adapt(location));
}
@Nullable
@Override
public <T> T getFacet(Class<? extends T> cls) {