Interface LocationManipulation

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.bukkit.Location getBlockLocation​(org.bukkit.Location l)
      This method simply does some rounding, rather than forcing a call to the server to get the blockdata.
      java.lang.String getDirection​(org.bukkit.Location location)
      Return the NESW Direction a Location is facing.
      org.bukkit.Location getNextBlock​(org.bukkit.entity.Vehicle v)
      Returns the next Location that a Vehicle is traveling at.
      float getSpeed​(org.bukkit.util.Vector v)
      Returns a speed float from a given vector.
      org.bukkit.util.Vector getTranslatedVector​(org.bukkit.util.Vector v, java.lang.String direction)
      Returns a translated vector from the given direction.
      float getYaw​(java.lang.String orientation)
      Returns the float yaw position for the given cardinal direction.
      java.lang.String locationToString​(org.bukkit.Location location)
      Convert a Location into a Colon separated string to allow us to store it in text.
      java.lang.String strCoords​(org.bukkit.Location l)
      Returns a colored string with the coords.
      java.lang.String strCoordsRaw​(org.bukkit.Location l)
      Converts a location to a printable readable formatted string including pitch/yaw.
      org.bukkit.Location stringToLocation​(java.lang.String locationString)
      Returns a new location from a given string.
    • Method Detail

      • locationToString

        java.lang.String locationToString​(org.bukkit.Location location)
        Convert a Location into a Colon separated string to allow us to store it in text.

        WORLD:X,Y,Z:yaw:pitch

        The corresponding String2Loc function is stringToLocation(java.lang.String)

        Parameters:
        location - The Location to save.
        Returns:
        The location as a string in this format: WORLD:x,y,z:yaw:pitch
      • getBlockLocation

        org.bukkit.Location getBlockLocation​(org.bukkit.Location l)
        This method simply does some rounding, rather than forcing a call to the server to get the blockdata.
        Parameters:
        l - The location to round to the block location
        Returns:
        A rounded location.
      • stringToLocation

        org.bukkit.Location stringToLocation​(java.lang.String locationString)
        Returns a new location from a given string. The format is as follows:

        WORLD:X,Y,Z:yaw:pitch

        The corresponding Location2String function is stringToLocation(java.lang.String)

        Parameters:
        locationString - The location represented as a string (WORLD:X,Y,Z:yaw:pitch)
        Returns:
        A new location defined by the string or null if the string was invalid.
      • strCoords

        java.lang.String strCoords​(org.bukkit.Location l)
        Returns a colored string with the coords.
        Parameters:
        l - The Location
        Returns:
        The String
      • strCoordsRaw

        java.lang.String strCoordsRaw​(org.bukkit.Location l)
        Converts a location to a printable readable formatted string including pitch/yaw.
        Parameters:
        l - The Location
        Returns:
        The String
      • getDirection

        java.lang.String getDirection​(org.bukkit.Location location)
        Return the NESW Direction a Location is facing.
        Parameters:
        location - The Location
        Returns:
        The NESW Direction
      • getYaw

        float getYaw​(java.lang.String orientation)
        Returns the float yaw position for the given cardinal direction.
        Parameters:
        orientation - The cardinal direction
        Returns:
        The yaw
      • getSpeed

        float getSpeed​(org.bukkit.util.Vector v)
        Returns a speed float from a given vector.
        Parameters:
        v - The Vector
        Returns:
        The speed
      • getTranslatedVector

        org.bukkit.util.Vector getTranslatedVector​(org.bukkit.util.Vector v,
                                                   java.lang.String direction)
        Returns a translated vector from the given direction.
        Parameters:
        v - The old Vector
        direction - The new direction
        Returns:
        The translated Vector
      • getNextBlock

        org.bukkit.Location getNextBlock​(org.bukkit.entity.Vehicle v)
        Returns the next Location that a Vehicle is traveling at.
        Parameters:
        v - The Vehicle
        Returns:
        The Location