public class LocationBuilder extends Object implements org.bukkit.configuration.serialization.ConfigurationSerializable, com.github.shynixn.petblocks.api.persistence.entity.IPosition
Do not remove this header!
Version 1.0
MIT License
Copyright (c) 2016
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Constructor and Description |
|---|
LocationBuilder()
Initializes a new LocationBuilder
|
LocationBuilder(Map<String,Object> items)
Parses the location out of the map
|
LocationBuilder(String worldName,
double x,
double y,
double z,
double yaw,
double pitch)
Initializes a new LocationBuilder with the given params
|
LocationBuilder(String worldName,
double x,
double y,
double z,
float yaw,
float pitch)
Initializes a new LocationBuilder with the given params
|
| Modifier and Type | Method and Description |
|---|---|
LocationBuilder |
addCoordinates(double x,
double y,
double z)
Adds or Subs the given coordinates x, y, z to or from the builder
|
LocationBuilder |
copy()
Copies the current builder
|
boolean |
equals(Object arg0)
Checks if 2 builders are equal
|
int |
getBlockX()
Returns the x coordinate as int of the builder
|
int |
getBlockY()
Returns the y coordinate as int of the builder
|
int |
getBlockZ()
Returns the z coordinate as int of the builder
|
long |
getId()
Returns the id of the object
|
double |
getPitch()
Returns the pitch of the builder
|
org.bukkit.World |
getWorld()
Returns the BukkitWorld of the builder
|
String |
getWorldName()
Returns the worldname of the builder
|
double |
getX()
Returns the x coordinate of the builder
|
double |
getY()
Returns the y coordinate of the builder
|
double |
getYaw()
Returns the yaw of the builder
|
double |
getZ()
Returns the z coordinate of the builder
|
LocationBuilder |
relativePosition(double distance,
com.github.shynixn.petblocks.api.persistence.entity.IPosition.Direction direction)
Returns the relativePosition to a given direction
|
Map<String,Object> |
serialize()
Serializes the location data to be stored to the filesystem
|
LocationBuilder |
setCoordinates(double x,
double y,
double z)
Sets the coordinates x, y, z
|
LocationBuilder |
setPitch(double pitch)
Sets the pitch of the builder
|
LocationBuilder |
setRotation(double yaw,
double pitch)
Sets the rotation yaw, pitch
|
LocationBuilder |
setWorld(org.bukkit.World world)
Sets the world of the builder
|
LocationBuilder |
setWorldName(String worldName)
Sets the worldName of the builder
|
LocationBuilder |
setX(double x)
Sets the x coordinate of the builder
|
LocationBuilder |
setY(double y)
Sets the y coordinate of the builder
|
LocationBuilder |
setYaw(double yaw)
Sets the yaw of the builder
|
LocationBuilder |
setZ(double z)
Sets the z coordinate of the builder
|
org.bukkit.util.EulerAngle |
toAngle()
Converts the builder to a bukkitEulerAngle
|
org.bukkit.Location |
toLocation()
Converts the builder to a bukkitLocation
|
String |
toString()
Displays the builder as string
|
org.bukkit.util.Vector |
toVector()
Converts the builder to a bukkitVector
|
public LocationBuilder()
public LocationBuilder(String worldName, double x, double y, double z, float yaw, float pitch)
worldName - worldNamex - xy - yz - zyaw - yawpitch - pitchpublic LocationBuilder(String worldName, double x, double y, double z, double yaw, double pitch)
worldName - worldNamex - xy - yz - zyaw - yawpitch - pitchpublic LocationBuilder setCoordinates(double x, double y, double z)
setCoordinates in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionx - xy - yz - zpublic LocationBuilder setRotation(double yaw, double pitch)
setRotation in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionyaw - yawpitch - pitchpublic LocationBuilder addCoordinates(double x, double y, double z)
addCoordinates in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionx - xy - yz - zpublic LocationBuilder setWorld(org.bukkit.World world)
world - worldpublic LocationBuilder setWorldName(String worldName)
setWorldName in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionworldName - worldNamepublic LocationBuilder setYaw(double yaw)
setYaw in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionyaw - yawpublic LocationBuilder setPitch(double pitch)
setPitch in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpitch - pitchpublic LocationBuilder setX(double x)
setX in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionx - xpublic LocationBuilder setY(double y)
setY in interface com.github.shynixn.petblocks.api.persistence.entity.IPositiony - ypublic LocationBuilder setZ(double z)
setZ in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionz - zpublic double getYaw()
getYaw in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic double getPitch()
getPitch in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic org.bukkit.World getWorld()
public double getX()
getX in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic double getY()
getY in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic double getZ()
getZ in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic int getBlockX()
getBlockX in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic int getBlockY()
getBlockY in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic int getBlockZ()
getBlockZ in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic String getWorldName()
getWorldName in interface com.github.shynixn.petblocks.api.persistence.entity.IPositionpublic LocationBuilder copy()
public org.bukkit.Location toLocation()
public org.bukkit.util.Vector toVector()
public org.bukkit.util.EulerAngle toAngle()
public LocationBuilder relativePosition(double distance, com.github.shynixn.petblocks.api.persistence.entity.IPosition.Direction direction)
relativePosition in interface com.github.shynixn.petblocks.api.persistence.entity.IPositiondistance - distancedirection - directionpublic boolean equals(Object arg0)
public String toString()
public Map<String,Object> serialize()
serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializablepublic long getId()
getId in interface com.github.shynixn.petblocks.api.persistence.entity.PersistenceableCopyright © 2017. All rights reserved.