Record Class BukkitLocation

java.lang.Object
java.lang.Record
kr.toxicity.model.api.bukkit.platform.BukkitLocation
Record Components:
source - the source Bukkit location
All Implemented Interfaces:
kr.toxicity.model.api.platform.PlatformLocation, kr.toxicity.model.api.platform.PlatformRegionHolder

public record BukkitLocation(@NotNull org.bukkit.Location source) extends Record implements kr.toxicity.model.api.platform.PlatformLocation
Represents a Bukkit location wrapped as a PlatformLocation.
Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    BukkitLocation(@NotNull org.bukkit.Location source)
    Creates an instance of a BukkitLocation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull kr.toxicity.model.api.platform.PlatformLocation
    add(double x, double y, double z)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
     
    @NotNull org.bukkit.Location
    Returns the value of the source record component.
    @Nullable kr.toxicity.model.api.scheduler.ModelTask
    task(@NotNull Runnable runnable)
     
    @Nullable kr.toxicity.model.api.scheduler.ModelTask
    taskLater(long delay, @NotNull Runnable runnable)
     
    final String
    Returns a string representation of this record class.
    @NotNull kr.toxicity.model.api.platform.PlatformWorld
     
    double
    x()
     
    double
    y()
     
    float
    yaw()
     
    double
    z()
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface kr.toxicity.model.api.platform.PlatformLocation

    distance, distanceSquared
  • Constructor Details

    • BukkitLocation

      public BukkitLocation(@NotNull @NotNull org.bukkit.Location source)
      Creates an instance of a BukkitLocation record class.
      Parameters:
      source - the value for the source record component
  • Method Details

    • world

      @NotNull public @NotNull kr.toxicity.model.api.platform.PlatformWorld world()
      Specified by:
      world in interface kr.toxicity.model.api.platform.PlatformLocation
    • x

      public double x()
      Specified by:
      x in interface kr.toxicity.model.api.platform.PlatformLocation
    • y

      public double y()
      Specified by:
      y in interface kr.toxicity.model.api.platform.PlatformLocation
    • z

      public double z()
      Specified by:
      z in interface kr.toxicity.model.api.platform.PlatformLocation
    • pitch

      public float pitch()
      Specified by:
      pitch in interface kr.toxicity.model.api.platform.PlatformLocation
    • yaw

      public float yaw()
      Specified by:
      yaw in interface kr.toxicity.model.api.platform.PlatformLocation
    • add

      @NotNull public @NotNull kr.toxicity.model.api.platform.PlatformLocation add(double x, double y, double z)
      Specified by:
      add in interface kr.toxicity.model.api.platform.PlatformLocation
    • task

      @Nullable public @Nullable kr.toxicity.model.api.scheduler.ModelTask task(@NotNull @NotNull Runnable runnable)
      Specified by:
      task in interface kr.toxicity.model.api.platform.PlatformRegionHolder
    • taskLater

      @Nullable public @Nullable kr.toxicity.model.api.scheduler.ModelTask taskLater(long delay, @NotNull @NotNull Runnable runnable)
      Specified by:
      taskLater in interface kr.toxicity.model.api.platform.PlatformRegionHolder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • source

      @NotNull public @NotNull org.bukkit.Location source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component