Interface IPos


  • public interface IPos
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      IPos add​(double x, double y, double z)
      Adds the IPos' coordinates by each of the parameters given.
      IPos add​(IPos pos)
      Directly adds the coordinates of two IPos objects and returns the resulting IPos sum.
      IPos crossProduct​(double x, double y, double z)  
      IPos crossProduct​(IPos pos)  
      double distanceTo​(double x, double y, double z)  
      double distanceTo​(IPos pos)  
      IPos divide​(double scalar)  
      IPos down()
      Shifts the IPos down by 1 block and returns the new object.
      IPos down​(double n)  
      IPos east()
      Shifts the IPos east by 1 block and returns the new object.
      IPos east​(double n)  
      IPos fromLong​(long serialized)  
      BlockPos getMCPos()  
      int getX()  
      double getXD()  
      int getY()  
      double getYD()  
      int getZ()  
      double getZD()  
      IPos normalize()
      Returns a normalized vector of this block's position, calculated by:
      double[] normalizeDouble()  
      IPos north()
      Shifts the IPos north by 1 block and returns the new object.
      IPos north​(double n)  
      IPos offset​(int direction)
      Offsets the block by 1 block in the given direction and returns the resulting IPos object
      IPos offset​(int direction, double n)
      Offsets the block by n blocks in the given direction and returns the resulting IPos object
      IPos south()
      Shifts the IPos south by 1 block and returns the new object.
      IPos south​(double n)  
      IPos subtract​(double x, double y, double z)
      Subtracts the IPos' coordinates by each of the parameters given.
      IPos subtract​(IPos pos)
      Directly subtracts the coordinates of two IPos objects and returns the resulting IPos difference.
      long toLong()  
      IPos up()
      Shifts the IPos up by 1 block and returns the new object.
      IPos up​(double n)  
      IPos west()
      Shifts the IPos west by 1 block and returns the new object.
      IPos west​(double n)  
    • Method Detail

      • getX

        int getX()
      • getY

        int getY()
      • getZ

        int getZ()
      • getXD

        double getXD()
      • getYD

        double getYD()
      • getZD

        double getZD()
      • up

        IPos up()
        Shifts the IPos up by 1 block and returns the new object.
      • up

        IPos up​(double n)
        Parameters:
        n - The number of blocks to move the position up by.
        Returns:
        The new IPos object.
      • down

        IPos down()
        Shifts the IPos down by 1 block and returns the new object.
      • down

        IPos down​(double n)
        Parameters:
        n - The number of blocks to move the position down by.
        Returns:
        The new IPos object.
      • north

        IPos north()
        Shifts the IPos north by 1 block and returns the new object.
      • north

        IPos north​(double n)
        Parameters:
        n - The number of blocks to move the position north by.
        Returns:
        The new IPos object.
      • east

        IPos east()
        Shifts the IPos east by 1 block and returns the new object.
      • east

        IPos east​(double n)
        Parameters:
        n - The number of blocks to move the position east by.
        Returns:
        The new IPos object.
      • south

        IPos south()
        Shifts the IPos south by 1 block and returns the new object.
      • south

        IPos south​(double n)
        Parameters:
        n - The number of blocks to move the position south by.
        Returns:
        The new IPos object.
      • west

        IPos west()
        Shifts the IPos west by 1 block and returns the new object.
      • west

        IPos west​(double n)
        Parameters:
        n - The number of blocks to move the position west by.
        Returns:
        The new IPos object.
      • add

        IPos add​(double x,
                 double y,
                 double z)
        Adds the IPos' coordinates by each of the parameters given.
        Parameters:
        x - X coordinate amount to be added
        y - Y coordinate amount to be added
        z - Z coordinate amount to be added
        Returns:
        The resulting IPos from the addition.
      • add

        IPos add​(IPos pos)
        Directly adds the coordinates of two IPos objects and returns the resulting IPos sum. For example, if one IPos was represented by the coordinates (0,60,5), and another by (-10,-30,25), the resulting object's coordinates are (0 - 10,60 - 30,5 + 25) = (-10,30,30).
        Parameters:
        pos - The position to be added to this IPos object.
        Returns:
        The sum of the two IPos objects as a new IPos object.
      • subtract

        IPos subtract​(double x,
                      double y,
                      double z)
        Subtracts the IPos' coordinates by each of the parameters given.
        Parameters:
        x - X coordinate amount to be subtracted
        y - Y coordinate amount to be subtracted
        z - Z coordinate amount to be subtracted
        Returns:
        The resulting IPos from the subtraction.
      • subtract

        IPos subtract​(IPos pos)
        Directly subtracts the coordinates of two IPos objects and returns the resulting IPos difference. For example, if one IPos was represented by the coordinates (0,60,5), and another by (-10,-30,25), the resulting object's coordinates are (0 + 10,60 + 30,5 - 25) = (10,90,-20).
        Parameters:
        pos - The position to be subtracted from this IPos object.
        Returns:
        The difference of the two IPos objects as a new IPos object.
      • normalize

        IPos normalize()
        Returns a normalized vector of this block's position, calculated by:
        Returns:
        The normalized vector of this block position.
      • normalizeDouble

        double[] normalizeDouble()
      • offset

        IPos offset​(int direction)
        Offsets the block by 1 block in the given direction and returns the resulting IPos object
      • offset

        IPos offset​(int direction,
                    double n)
        Offsets the block by n blocks in the given direction and returns the resulting IPos object
      • crossProduct

        IPos crossProduct​(double x,
                          double y,
                          double z)
      • crossProduct

        IPos crossProduct​(IPos pos)
      • divide

        IPos divide​(double scalar)
      • toLong

        long toLong()
      • fromLong

        IPos fromLong​(long serialized)
      • distanceTo

        double distanceTo​(IPos pos)
        Parameters:
        pos - The IPos object to calculate the distance to
        Returns:
        The distance between this IPos object and the other.
      • distanceTo

        double distanceTo​(double x,
                          double y,
                          double z)