Package noppes.npcs.api
Interface IPos
-
public interface IPos
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IPosadd(double x, double y, double z)Adds the IPos' coordinates by each of the parameters given.IPosadd(IPos pos)Directly adds the coordinates of two IPos objects and returns the resulting IPos sum.IPoscrossProduct(double x, double y, double z)IPoscrossProduct(IPos pos)doubledistanceTo(double x, double y, double z)doubledistanceTo(IPos pos)IPosdivide(double scalar)IPosdown()Shifts the IPos down by 1 block and returns the new object.IPosdown(double n)IPoseast()Shifts the IPos east by 1 block and returns the new object.IPoseast(double n)IPosfromLong(long serialized)BlockPosgetMCPos()intgetX()doublegetXD()intgetY()doublegetYD()intgetZ()doublegetZD()IPosnormalize()Returns a normalized vector of this block's position, calculated by:double[]normalizeDouble()IPosnorth()Shifts the IPos north by 1 block and returns the new object.IPosnorth(double n)IPosoffset(int direction)Offsets the block by 1 block in the given direction and returns the resulting IPos objectIPosoffset(int direction, double n)Offsets the block by n blocks in the given direction and returns the resulting IPos objectIPossouth()Shifts the IPos south by 1 block and returns the new object.IPossouth(double n)IPossubtract(double x, double y, double z)Subtracts the IPos' coordinates by each of the parameters given.IPossubtract(IPos pos)Directly subtracts the coordinates of two IPos objects and returns the resulting IPos difference.longtoLong()IPosup()Shifts the IPos up by 1 block and returns the new object.IPosup(double n)IPoswest()Shifts the IPos west by 1 block and returns the new object.IPoswest(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 addedy- Y coordinate amount to be addedz- 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 subtractedy- Y coordinate amount to be subtractedz- 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)
-
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)
-
getMCPos
BlockPos getMCPos()
-
-