Package dev.cwhead.GravesX.compatibility
Class CompatibilityTeleport
java.lang.Object
dev.cwhead.GravesX.compatibility.CompatibilityTeleport
Teleport compatibility layer for Paper/Folia vs. legacy servers.
- Tries Player#teleportAsync(Location, TeleportCause) if present.
- If missing or it fails, falls back to Player#teleport(Location, TeleportCause)
executed on the owning region thread via GravesX's UniversalScheduler.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Boolean> teleportSafely(org.bukkit.entity.Player player, org.bukkit.Location target, Graves plugin) Teleport withPlayerTeleportEvent.TeleportCause.PLUGIN.static CompletableFuture<Boolean> teleportSafely(org.bukkit.entity.Player player, org.bukkit.Location target, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, Graves plugin) Teleport with a specific cause, preferringteleportAsyncwhen available, and falling back to region-safeteleportviaGravesXScheduler.execute(...).
-
Method Details
-
teleportSafely
public static CompletableFuture<Boolean> teleportSafely(org.bukkit.entity.Player player, org.bukkit.Location target, Graves plugin) Teleport withPlayerTeleportEvent.TeleportCause.PLUGIN. -
teleportSafely
public static CompletableFuture<Boolean> teleportSafely(org.bukkit.entity.Player player, org.bukkit.Location target, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, Graves plugin) Teleport with a specific cause, preferringteleportAsyncwhen available, and falling back to region-safeteleportviaGravesXScheduler.execute(...).- Returns:
- a future that completes with
trueif the player ended up at the target.
-