Class XYZD

java.lang.Object
de.marcely.bedwars.tools.location.XYZ
de.marcely.bedwars.tools.location.XYZD
All Implemented Interfaces:
Cloneable, ConfigurationSerializable
Direct Known Subclasses:
ImmutableXYZD

public class XYZD extends XYZ implements Cloneable, ConfigurationSerializable
Represents a 3-dimensional position and a compass direction
  • Field Details

  • Constructor Details

    • XYZD

      public XYZD(Location loc)
    • XYZD

      public XYZD(Vector vec)
    • XYZD

      public XYZD(XYZ xyz)
    • XYZD

      public XYZD(XYZD xyz)
    • XYZD

      public XYZD()
    • XYZD

      public XYZD(double x, double y, double z)
    • XYZD

      public XYZD(double x, double y, double z, XYZD.Direction dir)
  • Method Details

    • setX

      public XYZD setX(double x)
      Description copied from class: XYZ
      Sets the x-coordinate
      Overrides:
      setX in class XYZ
      Parameters:
      x - The new x-coordinate
      Returns:
      This XYZ instance
    • setY

      public XYZD setY(double y)
      Description copied from class: XYZ
      Sets the y-coordinate
      Overrides:
      setY in class XYZ
      Parameters:
      y - The new y-coordinate
      Returns:
      This XYZ instance
    • setZ

      public XYZD setZ(double z)
      Description copied from class: XYZ
      Sets the z-coordinate
      Overrides:
      setZ in class XYZ
      Parameters:
      z - The new z-coordinate
      Returns:
      This XYZ instance
    • set

      public XYZD set(double x, double y, double z)
      Description copied from class: XYZ
      Sets the new coordinates
      Overrides:
      set in class XYZ
      Parameters:
      x - The new x-coordinate
      y - The new y-coordinate
      z - The new z-coordinate
      Returns:
      This XYZ instance
    • set

      public XYZD set(XYZ xyz)
      Description copied from class: XYZ
      Copies and sets the xyz coordinates from the given object
      Overrides:
      set in class XYZ
      Parameters:
      xyz - The object from which it shall be taken from
      Returns:
      This XYZ instance
    • set

      public XYZD set(Location loc)
      Description copied from class: XYZ
      Copies and sets the xyz coordinates from the given object
      Overrides:
      set in class XYZ
      Parameters:
      loc - The object from which it shall be taken from
      Returns:
      This XYZ instance
    • add

      public XYZD add(double x, double y, double z)
      Description copied from class: XYZ
      Adds the x-coordinates
      Overrides:
      add in class XYZ
      Parameters:
      x - The added x-coordinate
      y - The added y-coordinate
      z - The added z-coordinate
      Returns:
      This XYZ instance
    • add

      public XYZD add(XYZ xyz)
      Overrides:
      add in class XYZ
    • add

      public XYZD add(Location loc)
      Overrides:
      add in class XYZ
    • add

      public XYZD add(Vector vec)
      Overrides:
      add in class XYZ
    • subtract

      public XYZD subtract(double x, double y, double z)
      Overrides:
      subtract in class XYZ
    • subtract

      public XYZD subtract(XYZ xyz)
      Overrides:
      subtract in class XYZ
    • subtract

      public XYZD subtract(Location loc)
      Overrides:
      subtract in class XYZ
    • subtract

      public XYZD subtract(Vector vec)
      Overrides:
      subtract in class XYZ
    • multiply

      public XYZD multiply(double amount)
      Overrides:
      multiply in class XYZ
    • multiply

      public XYZD multiply(double x, double y, double z)
      Overrides:
      multiply in class XYZ
    • zero

      public XYZD zero()
      Description copied from class: XYZ
      Sets all coordinates to 0
      Overrides:
      zero in class XYZ
      Returns:
      This XYZ instance
    • toLocation

      public Location toLocation(World world)
      Description copied from class: XYZ
      Converts this XYZ object to a new Location object
      Overrides:
      toLocation in class XYZ
      Parameters:
      world - The world needed for creating the Location
      Returns:
      A new location whose coordinates where taken from this object
    • set

      public XYZD set(XYZD xyz)
      Copies and sets the xyz coordinates and direction coordinates from the given object
      Parameters:
      xyz - The object from which it shall be taken from
      Returns:
      This XYZ instance
    • getDirection

      public XYZD.Direction getDirection()
    • setDirection

      public XYZD setDirection(XYZD.Direction dir)
    • clone

      public XYZD clone()
      Overrides:
      clone in class XYZ
    • serialize

      public Map<String,Object> serialize()
      Specified by:
      serialize in interface ConfigurationSerializable
      Overrides:
      serialize in class XYZ
    • deserialize

      public static XYZD deserialize(Map<String,Object> data)
      Required method for deserialization
      Parameters:
      data - map to deserialize
      Returns:
      deserialized xyzd instance
      See Also: