@nxg-org/mineflayer-util-plugin 1.3.11 → 1.3.12
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.
|
@@ -37,7 +37,7 @@ export declare class MovementFunctions {
|
|
|
37
37
|
* @returns have the goals changed
|
|
38
38
|
*/
|
|
39
39
|
followEntityWithRespectRange(entity: Entity, followDistance: number, invertDistance?: number): boolean;
|
|
40
|
-
forceLook(yaw: number, pitch: number, update?: boolean): void;
|
|
41
|
-
forceLookAt(pos: Vec3, update?: boolean): void;
|
|
40
|
+
forceLook(yaw: number, pitch: number, onGround?: boolean, update?: boolean): void;
|
|
41
|
+
forceLookAt(pos: Vec3, onGround?: boolean, update?: boolean): void;
|
|
42
42
|
lazyTeleport(endPos: Vec3): void;
|
|
43
43
|
}
|
package/lib/movementFunctions.js
CHANGED
|
@@ -92,19 +92,19 @@ class MovementFunctions {
|
|
|
92
92
|
}
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
|
-
forceLook(yaw, pitch, update = false) {
|
|
95
|
+
forceLook(yaw, pitch, onGround, update = false) {
|
|
96
96
|
const notchianYawAndPitch = { yaw: this.bot.util.math.toNotchianYaw(yaw), pitch: this.bot.util.math.toNotchianPitch(pitch) };
|
|
97
|
-
this.bot._client.write("look", notchianYawAndPitch);
|
|
97
|
+
this.bot._client.write("look", Object.assign(Object.assign({}, notchianYawAndPitch), { onGround: onGround !== null && onGround !== void 0 ? onGround : this.bot.entity.onGround }));
|
|
98
98
|
if (update) {
|
|
99
99
|
this.bot.entity.yaw = yaw;
|
|
100
100
|
this.bot.entity.pitch = pitch;
|
|
101
101
|
// this.bot.look(yaw, pitch, true);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
forceLookAt(pos, update = false) {
|
|
104
|
+
forceLookAt(pos, onGround, update = false) {
|
|
105
105
|
const { yaw, pitch } = this.bot.util.math.pointToYawAndPitch(this.bot, pos);
|
|
106
106
|
const nyp = { yaw: this.bot.util.math.toNotchianYaw(yaw), pitch: this.bot.util.math.toNotchianPitch(pitch) };
|
|
107
|
-
this.bot._client.write("look", nyp);
|
|
107
|
+
this.bot._client.write("look", Object.assign(Object.assign({}, nyp), { onGround: onGround !== null && onGround !== void 0 ? onGround : this.bot.entity.onGround }));
|
|
108
108
|
if (update) {
|
|
109
109
|
this.bot.entity.yaw = yaw;
|
|
110
110
|
this.bot.entity.pitch = pitch;
|