public class Location extends java.lang.Object implements ILocation
| Constructor and Description |
|---|
Location(int... coordinates)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ILocation |
add(ILocation location)
Add this location to a given location.
|
int |
compareTo(ILocation o) |
ILocation |
copy()
Copy this location.
|
boolean |
equals(java.lang.Object object) |
void |
fromNBT(net.minecraft.nbt.NBTTagCompound tag)
Read the data from an NBT tag and place it in this object.
|
int[] |
getCoordinates()
Get the coordinates for this location.
|
Size |
getDifference(ILocation location)
Get the difference between this and the given location.
|
int |
getDimensions()
Get the amount of dimensions this location is defined in.
|
int |
getDistance(ILocation location)
Get the distance between this and the given location.
|
void |
setCoordinates(int[] coordinates)
Set the coordinates for this location.
|
ILocation |
subtract(ILocation location)
Subtract this location with a given location.
|
net.minecraft.nbt.NBTTagCompound |
toNBT()
Convert the data to an NBT tag.
|
java.lang.String |
toString() |
public Location(int... coordinates)
coordinates - The coordinates.public int getDimensions()
ILocationgetDimensions in interface ILocationpublic int[] getCoordinates()
ILocationgetCoordinates in interface ILocationpublic void setCoordinates(int[] coordinates)
ILocationsetCoordinates in interface ILocationcoordinates - The coordinates.public Size getDifference(ILocation location)
ILocationgetDifference in interface ILocationlocation - The location to calculate the difference with.public int getDistance(ILocation location)
ILocationgetDistance in interface ILocationlocation - The location to calculate the distance with.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int compareTo(ILocation o)
compareTo in interface java.lang.Comparable<ILocation>public net.minecraft.nbt.NBTTagCompound toNBT()
INBTSerializabletoNBT in interface INBTSerializablepublic void fromNBT(net.minecraft.nbt.NBTTagCompound tag)
INBTSerializablefromNBT in interface INBTSerializabletag - The tag to read from.public ILocation subtract(ILocation location)
ILocation