Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions paper-api/src/main/java/org/bukkit/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,25 @@ final class Holder {
return this.teleportAsync(loc, cause, Holder.EMPTY_FLAGS);
}

/**
* Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
* @param destination Entity to teleport to
* @return A future that will be completed with the result of the teleport
*/
default java.util.concurrent.@NotNull CompletableFuture<Boolean> teleportAsync(final @NotNull Entity destination) {
return this.teleportAsync(destination.getLocation(), TeleportCause.PLUGIN);
}

/**
* Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
* @param destination Entity to teleport to
* @param cause Reason for teleport
* @return A future that will be completed with the result of the teleport
*/
default java.util.concurrent.@NotNull CompletableFuture<Boolean> teleportAsync(final @NotNull Entity destination, final @NotNull TeleportCause cause) {
return this.teleportAsync(destination.getLocation(), cause);
}

/**
* Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
* @param loc Location to teleport to
Expand Down