Add alot
This commit is contained in:
@@ -1,5 +1,31 @@
|
||||
import { Vector3 } from "@minecraft/server";
|
||||
|
||||
enum Direction {
|
||||
North = 0,
|
||||
East = 1,
|
||||
South = 2,
|
||||
West = 3,
|
||||
Up = 4,
|
||||
Down = 5,
|
||||
}
|
||||
|
||||
function directionToVector3(direction: Direction): Vector3 {
|
||||
switch (direction) {
|
||||
case Direction.North:
|
||||
return vector3(0, 0, -1);
|
||||
case Direction.East:
|
||||
return vector3(1, 0, 0);
|
||||
case Direction.South:
|
||||
return vector3(0, 0, 1);
|
||||
case Direction.West:
|
||||
return vector3(-1, 0, 0);
|
||||
case Direction.Up:
|
||||
return vector3(0, 1, 0);
|
||||
case Direction.Down:
|
||||
return vector3(0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function vector3(x: number, y: number, z: number): Vector3 {
|
||||
return { x: x, y: y, z: z };
|
||||
}
|
||||
@@ -55,6 +81,8 @@ function vector3Distance(vector1: Vector3, vector2: Vector3): number {
|
||||
}
|
||||
|
||||
export {
|
||||
Direction,
|
||||
directionToVector3,
|
||||
Vector3ToString,
|
||||
Vector3ToFancyString,
|
||||
Vector3Add,
|
||||
|
||||
Reference in New Issue
Block a user