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.
Importing the class
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.
Implemented Interfaces
MCVector3i implements the following interfaces. That means all methods defined in these interfaces are also available in MCVector3i
- Comparable<MCVector3i>
Constructors
Parameter | Type | Description |
---|---|---|
Parameter x | Type int | Description No description provided |
Parameter y | Type int | Description No description provided |
Parameter z | Type int | Description No description provided |
Casters
Result type | Is Implicit |
---|---|
Result type MCVector3d | Is Implicit false |
Methods
Return Type: MCVector3d
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
Parameter | Type | Description |
---|---|---|
Parameter vec | Type MCVector3i | Description Vector3i to cross product |
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
Parameter | Type | Description |
---|---|---|
Parameter to | Type MCVector3i | Description Vector3i to check against |
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
Parameter | Type | Description |
---|---|---|
Parameter position | Type IPosition | Description Vector3i to check against |
Parameter useCenter | Type boolean | Description should the center of the coordinate be used? (adds 0.5 to each value) |
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
Parameter | Type | Description |
---|---|---|
Parameter x | Type double | Description x position to check against |
Parameter y | Type double | Description y position to check against |
Parameter z | Type double | Description z position to check against |
Parameter useCenter | Type boolean | Description should the center of the coordinate be used? (adds 0.5 to each value) |
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
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
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No Description Provided |
Return Type: string
Gets the X coordinate of this vector.
Returns: The X coordinate.
Return Type: int
Gets the Y coordinate of this vector.
Returns: The Y coordinate.
Return Type: int
Gets the Y coordinate of this vector.
Returns: The Y coordinate.
Return Type: int
Gets the Manhattan Distance of this vector compared to a different vector
Returns: The manhattan distance of the vectors
Return Type: int
Parameter | Type | Description |
---|---|---|
Parameter vector | Type MCVector3i | Description other vector to get the distance to |
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
Parameter | Type | Description |
---|---|---|
Parameter facing | Type Direction | Description No Description Provided |
Parameter n | Type int | Description No Description Provided |
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
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
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No Description Provided |
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
Parameter | Type | Description |
---|---|---|
Parameter vector | Type MCVector3i | Description Vector3i to check if it is within the distance |
Parameter distance | Type double | Description distance to check within |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name coordinateString | Type string | Has Getter true | Has Setter false | Description No Description Provided |
Name x | Type int | Has Getter true | Has Setter false | Description Gets the X coordinate of this vector. |
Name y | Type int | Has Getter true | Has Setter false | Description Gets the Y coordinate of this vector. |
Name z | Type int | Has Getter true | Has Setter false | Description Gets the Y coordinate of this vector. |