File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
paper-api/src/main/java/org/bukkit/entity Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,22 @@ final class Holder {
277277 return this .teleportAsync (loc , cause , Holder .EMPTY_FLAGS );
278278 }
279279
280+ /**
281+ * Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
282+ * <p>
283+ * Note: This uses default in game behavior for teleportation, especially in regard to handling
284+ * passengers and vehicles across dimensions. It should be noted at this moment, teleporting a {@link Player}
285+ * with passengers across dimensions is not supported and will cause the future to return false. This behavior may
286+ * change in future versions.
287+ *
288+ * @param loc Location to teleport to
289+ * @param teleportFlags Flags to be used in this teleportation
290+ * @return A future that will be completed with the result of the teleport
291+ */
292+ default java .util .concurrent .@ NotNull CompletableFuture <Boolean > teleportAsync (@ NotNull Location loc , @ NotNull io .papermc .paper .entity .TeleportFlag @ NotNull ... teleportFlags ) {
293+ return this .teleportAsync (loc , TeleportCause .PLUGIN , teleportFlags );
294+ }
295+
280296 /**
281297 * Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
282298 * <p>
You can’t perform that action at this time.
0 commit comments