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, preferringteleportAsync
when available, and falling back to region-safeteleport
viaGravesXScheduler.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, preferringteleportAsync
when available, and falling back to region-safeteleport
viaGravesXScheduler.execute(...)
.- Returns:
- a future that completes with
true
if the player ended up at the target.
-