Class LocationHandler

java.lang.Object
me.yleoft.zAPI.location.LocationHandler

public final class LocationHandler extends Object
  • Constructor Details

    • LocationHandler

      public LocationHandler()
  • Method Details

    • serialize

      public static String serialize(@NotNull @NotNull org.bukkit.Location location)
      Serializes a Location object into a string format.
      Parameters:
      location - the Location to serialize
      Returns:
      a string representation of the Location
    • serialize

      public static String serialize(@NotNull @NotNull String world, double x, double y, double z, float yaw, float pitch)
      Serializes the given parameters into a string format.
      Parameters:
      world - the name of the world
      x - the x-coordinate
      y - the y-coordinate
      z - the z-coordinate
      yaw - the yaw angle
      pitch - the pitch angle
      Returns:
      a string representation of the parameters
    • deserialize

      public static org.bukkit.Location deserialize(@NotNull @NotNull String serialized)
      Deserializes a string into a Location object.
      Parameters:
      serialized - the serialized string
      Returns:
      a Location object representing the serialized data
    • findNearestSafeLocation

      @Nullable public static @Nullable org.bukkit.Location findNearestSafeLocation(@NotNull @NotNull org.bukkit.Location origin, int radius, int heightCheckRange)
      Finds the nearest safe location from the given origin within a specified radius.
      Parameters:
      origin - the starting location
      radius - the search radius
      heightCheckRange - the range to check for height variations
      Returns:
      a safe location if found, otherwise null
    • findNearestSafeLocationAsync

      @NotNull public static @NotNull CompletableFuture<org.bukkit.Location> findNearestSafeLocationAsync(@NotNull @NotNull org.bukkit.Location origin, int radius, int heightCheckRange)
    • isSafeLocation

      public static boolean isSafeLocation(@NotNull @NotNull org.bukkit.Location loc)
      Checks if the given location is safe for a player to stand on.
      Parameters:
      loc - the location to check
      Returns:
      true if the location is safe, false otherwise
    • isSafeLocationAsync

      @NotNull public static @NotNull CompletableFuture<Boolean> isSafeLocationAsync(@NotNull @NotNull org.bukkit.Location loc)