Interface PlatformLocation

All Superinterfaces:
PlatformRegionHolder

public interface PlatformLocation extends PlatformRegionHolder
Represents a location in the underlying platform.

This interface provides access to coordinates, rotation, and the world, as well as methods for manipulating the location.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    add(double x, double y, double z)
    Creates a new location by adding the specified coordinates to this location.
    default double
    distance(@NotNull PlatformLocation other)
    Calculates the distance between this location and another location.
    default double
    Calculates the squared distance between this location and another location.
    float
    Returns the pitch (vertical rotation).
    Returns the world associated with this location.
    double
    x()
    Returns the X coordinate.
    double
    y()
    Returns the Y coordinate.
    float
    yaw()
    Returns the yaw (horizontal rotation).
    double
    z()
    Returns the Z coordinate.

    Methods inherited from interface PlatformRegionHolder

    task, taskLater
  • Method Details

    • world

      PlatformWorld world()
      Returns the world associated with this location.
      Returns:
      the world
      Since:
      2.0.0
    • x

      double x()
      Returns the X coordinate.
      Returns:
      the X coordinate
      Since:
      2.0.0
    • y

      double y()
      Returns the Y coordinate.
      Returns:
      the Y coordinate
      Since:
      2.0.0
    • z

      double z()
      Returns the Z coordinate.
      Returns:
      the Z coordinate
      Since:
      2.0.0
    • pitch

      float pitch()
      Returns the pitch (vertical rotation).
      Returns:
      the pitch
      Since:
      2.0.0
    • yaw

      float yaw()
      Returns the yaw (horizontal rotation).
      Returns:
      the yaw
      Since:
      2.0.0
    • add

      @NotNull @NotNull PlatformLocation add(double x, double y, double z)
      Creates a new location by adding the specified coordinates to this location.
      Parameters:
      x - the X offset
      y - the Y offset
      z - the Z offset
      Returns:
      the new location
      Since:
      2.0.0
    • distance

      default double distance(@NotNull @NotNull PlatformLocation other)
      Calculates the distance between this location and another location.
      Parameters:
      other - the other location
      Returns:
      the distance
      Since:
      2.1.0
    • distanceSquared

      default double distanceSquared(@NotNull @NotNull PlatformLocation other)
      Calculates the squared distance between this location and another location.
      Parameters:
      other - the other location
      Returns:
      the squared distance
      Since:
      2.1.0