Class CompatibilityTeleport

java.lang.Object
dev.cwhead.GravesX.compatibility.CompatibilityTeleport

public final class CompatibilityTeleport extends Object
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 Details

    • teleportSafely

      public static CompletableFuture<Boolean> teleportSafely(org.bukkit.entity.Player player, org.bukkit.Location target, Graves plugin)
      Teleport with PlayerTeleportEvent.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, preferring teleportAsync when available, and falling back to region-safe teleport via GravesXScheduler.execute(...).
      Returns:
      a future that completes with true if the player ended up at the target.