Record Class HudCompass.CompassPoint

java.lang.Object
java.lang.Record
io.github.nacvark.hudengine.api.HudCompass.CompassPoint
Record Components:
icon - a custom-icon key from the compass definition, or null for the default marker
radius - only show within this many blocks; zero means always
Enclosing interface:
HudCompass

public static record HudCompass.CompassPoint(String world, double x, double y, double z, String icon, double radius) extends Record
Somewhere a compass can point.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompassPoint(String world, double x, double y, double z, String icon, double radius)
    Creates an instance of a CompassPoint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    at(org.bukkit.Location location, String icon)
    A point at a location, with height.
    final boolean
    Indicates whether some other object is "equal to" this one.
    flat(String world, double x, double z, String icon)
    A point with no height, which is always measured on the flat.
    final int
    Returns a hash code value for this object.
    boolean
    Whether this point carries a height at all.
    Returns the value of the icon record component.
    double
    Returns the value of the radius record component.
    final String
    Returns a string representation of this record class.
    within(org.bukkit.Location location, String icon, double radius)
    A point at a location that only appears within radius blocks.
    Returns the value of the world record component.
    double
    x()
    Returns the value of the x record component.
    double
    y()
    Returns the value of the y record component.
    double
    z()
    Returns the value of the z record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CompassPoint

      public CompassPoint(String world, double x, double y, double z, String icon, double radius)
      Creates an instance of a CompassPoint record class.
      Parameters:
      world - the value for the world record component
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
      icon - the value for the icon record component
      radius - the value for the radius record component
  • Method Details

    • flat

      public static HudCompass.CompassPoint flat(String world, double x, double z, String icon)
      A point with no height, which is always measured on the flat.
    • at

      public static HudCompass.CompassPoint at(org.bukkit.Location location, String icon)
      A point at a location, with height.
    • within

      public static HudCompass.CompassPoint within(org.bukkit.Location location, String icon, double radius)
      A point at a location that only appears within radius blocks.
    • hasHeight

      public boolean hasHeight()
      Whether this point carries a height at all.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • world

      public String world()
      Returns the value of the world record component.
      Returns:
      the value of the world record component
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      public double z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component
    • icon

      public String icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • radius

      public double radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component