MCVector3i
Link to mcvector3i
A 3-dimensional vector, in a 3-dimensional vector space.
This class is immutable, meaning its values cannot change, so it is safe to be stored as a key in maps or in collections.
No, it's not an arrow.
Импорт класса
Link to импорт-класса
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.util.MCVector3i;
Implemented Interfaces
Link to implemented-interfaces
MCVector3i implements the following interfaces. That means all methods defined in these interfaces are also available in MCVector3i
- Comparable<MCVector3i>
Constructors
Link to constructors
ZenScript Copynew MCVector3i(x as int, y as int, z as int) as MCVector3i
Параметр | Тип | Описание |
---|---|---|
Параметр x | Тип int | Описание Описание отсутствует |
Параметр y | Тип int | Описание Описание отсутствует |
Параметр z | Тип int | Описание Описание отсутствует |
Утилиты
Link to утилиты
Тип результата | Является неявным |
---|---|
Тип результата MCVector3d | Является неявным false |
Методы
Link to методы
Name: asVector3i
Return Type: MCVector3d
ZenScript Copy// MCVector3i.asVector3i() as MCVector3d
myMCVector3i.asVector3i();
Name: crossProduct
Creates a new Vector3i based on the cross product of this position, and the given position
Returns: a new Vector3i based on the cross product of this Vector3i and the given Vector3i
Return Type: MCVector3i
ZenScript CopyMCVector3i.crossProduct(vec as MCVector3i) as MCVector3i
Параметр | Тип | Описание |
---|---|---|
Параметр vec | Тип MCVector3i | Описание Vector3i to cross product |
Name: distanceSq
Gets the squared distance of this position to the specified Vector3i, using the center of the Vector3i
Returns: the squared distance of this current position and the given Vector3i.
Return Type: double
ZenScript Copy// MCVector3i.distanceSq(to as MCVector3i) as double
myMCVector3i.distanceSq(new Vector3i(256, 128, 10););
Параметр | Тип | Описание |
---|---|---|
Параметр to | Тип MCVector3i | Описание Vector3i to check against |
Name: distanceSq
Gets the squared distance of this position to the specified Vector3i
Returns: the squared distance of this current position and the given Vector3i.
Return Type: double
ZenScript CopyMCVector3i.distanceSq(position as IPosition, useCenter as boolean) as double
Параметр | Тип | Описание |
---|---|---|
Параметр position | Тип IPosition | Описание Vector3i to check against |
Параметр useCenter | Тип boolean | Описание should the center of the coordinate be used? (adds 0.5 to each value) |
Name: distanceSq
Gets the squared distance of this position to the specified coordinates
Returns: the squared distance of this current position and the given coordinates.
Return Type: double
ZenScript Copy// MCVector3i.distanceSq(x as double, y as double, z as double, useCenter as boolean) as double
myMCVector3i.distanceSq(500.25, 250.75, 100.20, false);
Параметр | Тип | Описание |
---|---|---|
Параметр x | Тип double | Описание x position to check against |
Параметр y | Тип double | Описание y position to check against |
Параметр z | Тип double | Описание z position to check against |
Параметр useCenter | Тип boolean | Описание should the center of the coordinate be used? (adds 0.5 to each value) |
Name: down
Creates a new Vector3i based on this Vector3i that is one block lower than this Vector3i
Returns: a new Vector3i that is one block lower than this Vector3i
Return Type: MCVector3i
ZenScript Copy// MCVector3i.down() as MCVector3i
myMCVector3i.down();
Name: down
Creates a new Vector3i based on this Vector3i that is n block(s) lower than this Vector3i
Returns: a new Vector3i that is n block(s) lower than this Vector3i
Return Type: MCVector3i
ZenScript CopyMCVector3i.down(n as int) as MCVector3i
Параметр | Тип | Описание |
---|---|---|
Параметр n | Тип int | Описание No Description Provided |
Name: getCoordinatesAsString
Return Type: string
ZenScript Copy// MCVector3i.getCoordinatesAsString() as string
myMCVector3i.getCoordinatesAsString();
Name: getX
Gets the X coordinate of this vector.
Returns: The X coordinate.
Return Type: int
ZenScript Copy// MCVector3i.getX() as int
myMCVector3i.getX();
Name: getY
Gets the Y coordinate of this vector.
Returns: The Y coordinate.
Return Type: int
ZenScript Copy// MCVector3i.getY() as int
myMCVector3i.getY();
Name: getZ
Gets the Y coordinate of this vector.
Returns: The Y coordinate.
Return Type: int
ZenScript Copy// MCVector3i.getZ() as int
myMCVector3i.getZ();
Name: manhattanDistance
Gets the Manhattan Distance of this vector compared to a different vector
Returns: The manhattan distance of the vectors
Return Type: int
ZenScript CopyMCVector3i.manhattanDistance(vector as MCVector3i) as int
Параметр | Тип | Описание |
---|---|---|
Параметр vector | Тип MCVector3i | Описание other vector to get the distance to |
Name: offset
Creates a new Vector3i based on this Vector3i that is one block offset of this Vector3i based on the given Direction
Returns: a new Vector3i that is 1 block offset of this Vector3i
Return Type: MCVector3i
ZenScript CopyMCVector3i.offset(facing as Direction, n as int) as MCVector3i
Параметр | Тип | Описание |
---|---|---|
Параметр facing | Тип Direction | Описание No Description Provided |
Параметр n | Тип int | Описание No Description Provided |
Name: up
Creates a new Vector3i based on this Vector3i that is one block higher than this Vector3i
Returns: a new Vector3i that is one block higher than this Vector3i
Return Type: MCVector3i
ZenScript Copy// MCVector3i.up() as MCVector3i
myMCVector3i.up();
Name: up
Creates a new Vector3i based on this Vector3i that is n block(s) higher than this Vector3i
Returns: a new Vector3i that is n block(s) higher than this Vector3i
Return Type: MCVector3i
ZenScript Copy// MCVector3i.up(n as int) as MCVector3i
myMCVector3i.up(45);
Параметр | Тип | Описание |
---|---|---|
Параметр n | Тип int | Описание No Description Provided |
Name: withinDistance
Checks if the given Vector3i is within the specified distance of this Vector3i (this uses the middle of the Vector3i)
Returns: true if the given Vector3i is within the given distance of this Vector3i
Return Type: boolean
ZenScript CopyMCVector3i.withinDistance(vector as MCVector3i, distance as double) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр vector | Тип MCVector3i | Описание Vector3i to check if it is within the distance |
Параметр distance | Тип double | Описание distance to check within |
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название coordinateString | Тип string | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название x | Тип int | Имеет Getter true | Имеет Setter false | Описание Gets the X coordinate of this vector. |
Название y | Тип int | Имеет Getter true | Имеет Setter false | Описание Gets the Y coordinate of this vector. |
Название z | Тип int | Имеет Getter true | Имеет Setter false | Описание Gets the Y coordinate of this vector. |