Class XYZYP

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

public class XYZYP extends XYZ implements Cloneable, ConfigurationSerializable
Represents a 3-dimensional position with a yaw and pitch direction
  • Constructor Details

    • XYZYP

      public XYZYP(Location loc)
    • XYZYP

      public XYZYP(Vector vec)
    • XYZYP

      public XYZYP(XYZ xyz)
    • XYZYP

      public XYZYP(XYZYP xyz)
    • XYZYP

      public XYZYP()
    • XYZYP

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

      public XYZYP(double x, double y, double z, float yaw, float pitch)
  • Method Details

    • setX

      public XYZYP 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 XYZYP 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 XYZYP 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 XYZYP 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 XYZYP 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 XYZYP 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 XYZYP add(double x, double y, double z)
      Description copied from class: XYZ
      Adds the x-coordinates
      Overrides:
      add in class XYZ
      Parameters:
      x - The new x-coordinate
      y - The new y-coordinate
      z - The new z-coordinate
      Returns:
      This XYZ instance
    • add

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

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

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

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

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

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

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

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

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

      public XYZYP 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 XYZYP set(XYZYP xyz)
      Copies and sets the xyz coordinates and yaw/pitch coordinates from the given object
      Parameters:
      xyz - The object from which it shall be taken from
      Returns:
      This XYZ instance
    • getYaw

      public float getYaw()
    • getPitch

      public float getPitch()
    • setYaw

      public XYZYP setYaw(float yaw)
    • setPitch

      public XYZYP setPitch(float pitch)
    • clone

      public XYZYP 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 XYZYP deserialize(Map<String,Object> data)
      Required method for deserialization
      Parameters:
      data - map to deserialize
      Returns:
      deserialized xyz instance
      See Also: