java.lang.Object
me.gamercoder215.starcosmetics.api.cosmetics.structure.StructurePoint
All Implemented Interfaces:
Comparable<StructurePoint>

public final class StructurePoint extends Object implements Comparable<StructurePoint>
Represents a point on a Structure.
  • Constructor Details

    • StructurePoint

      public StructurePoint(int x, int y, int z)
      Creates a new StructurePoint.
      Parameters:
      x - Relative X to the Center
      y - Relative Y to the Center
      z - Relative Z to the Center
    • StructurePoint

      public StructurePoint(@NotNull @NotNull Vector v)
      Constructs a StructurePoint from a Vector.
      Parameters:
      v - Vector
    • StructurePoint

      public StructurePoint(double x, double y, double z)
      Creates a new StructurePoint.
      Parameters:
      x - Relative X to the Center
      y - Relative Y to the Center
      z - Relative Z to the Center
  • Method Details

    • getX

      public int getX()
      Fetches the relative X distance to the Center.
      Returns:
      Relative X Distance
    • getY

      public int getY()
      Fetches the relative Y distance to the Center.
      Returns:
      Relative Y Distance
    • getZ

      public int getZ()
      Fetches the relative Z distance to the Center.
      Returns:
      Relative Z Distance
    • toLocation

      @NotNull public @NotNull Location toLocation(@NotNull @NotNull Location relative)
      Converts this StructurePoint to a Location.
      Parameters:
      relative - Center Location
      Returns:
      Location of this StructurePoint according to the relative Location
    • toVector

      @NotNull public @NotNull Vector toVector()
      Converts this StructurePoint to a Vector, inputting its actual X, Y, and Z.
      Returns:
      Vector of this StructurePoint
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(@NotNull @NotNull StructurePoint o)
      Specified by:
      compareTo in interface Comparable<StructurePoint>