@nxg-org/mineflayer-util-plugin 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/calcs/intercept.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Bot } from "mineflayer";
|
|
2
2
|
import { Block } from "prismarine-block";
|
|
3
3
|
import { Vec3 } from "vec3";
|
|
4
|
+
import { Intersection } from "./iterators";
|
|
4
5
|
type Iteration = {
|
|
5
6
|
x: number;
|
|
6
7
|
y: number;
|
|
@@ -10,6 +11,7 @@ type Iteration = {
|
|
|
10
11
|
type BlockAndIterations = {
|
|
11
12
|
block: Block | null;
|
|
12
13
|
iterations: Iteration[];
|
|
14
|
+
intersect?: Intersection;
|
|
13
15
|
};
|
|
14
16
|
export declare class InterceptFunctions {
|
|
15
17
|
private bot;
|
package/lib/calcs/intercept.js
CHANGED
package/lib/calcs/iterators.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare enum BlockFace {
|
|
|
8
8
|
WEST = 4,
|
|
9
9
|
EAST = 5
|
|
10
10
|
}
|
|
11
|
+
export type Intersection = {
|
|
12
|
+
pos: Vec3;
|
|
13
|
+
face: BlockFace;
|
|
14
|
+
};
|
|
11
15
|
export declare class RaycastIterator {
|
|
12
16
|
block: {
|
|
13
17
|
x: number;
|
|
@@ -32,10 +36,7 @@ export declare class RaycastIterator {
|
|
|
32
36
|
tMaxZ: number;
|
|
33
37
|
maxDistance: number;
|
|
34
38
|
constructor(pos: Vec3, dir: Vec3, maxDistance: number);
|
|
35
|
-
intersect(shapes: [x0: number, y0: number, z0: number, x1: number, y1: number, z1: number][], offset: Vec3):
|
|
36
|
-
pos: Vec3;
|
|
37
|
-
face: BlockFace;
|
|
38
|
-
} | null;
|
|
39
|
+
intersect(shapes: [x0: number, y0: number, z0: number, x1: number, y1: number, z1: number][], offset: Vec3): Intersection | null;
|
|
39
40
|
next(): {
|
|
40
41
|
x: number;
|
|
41
42
|
y: number;
|
package/lib/movementFunctions.js
CHANGED
|
@@ -39,7 +39,7 @@ class MovementFunctions {
|
|
|
39
39
|
this.lastSentPitch = NaN;
|
|
40
40
|
this.pendingLookSync = null;
|
|
41
41
|
this.trackSentRotation = this.captureSentRotation.bind(this);
|
|
42
|
-
this.
|
|
42
|
+
this.bot.on("spawn", this.trackSentRotation); // should clear the sent rotation when the bot respawns,
|
|
43
43
|
this.bot.on("move", this.trackSentRotation);
|
|
44
44
|
}
|
|
45
45
|
captureSentRotation() {
|