@nxg-org/mineflayer-physics-util 1.9.1 → 1.9.3

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/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ declare module "mineflayer" {
8
8
  }
9
9
  export default function loader(bot: Bot): void;
10
10
  export declare function initSetup(data: IndexedData): void;
11
+ export { PhysicsUtilWrapper } from "./wrapper";
11
12
  export { EPhysicsCtx, PhysicsWorldSettings } from "./physics/settings";
12
13
  export { BaseSimulator } from "./simulators";
13
14
  export { EntityPhysics, BotcraftPhysics } from "./physics/engines";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyToPlayerState = exports.convertPlayerState = exports.ControlStateHandler = exports.PlayerPoses = exports.PlayerState = exports.EntityState = exports.BotcraftPhysics = exports.EntityPhysics = exports.BaseSimulator = exports.PhysicsWorldSettings = exports.EPhysicsCtx = void 0;
3
+ exports.applyToPlayerState = exports.convertPlayerState = exports.ControlStateHandler = exports.PlayerPoses = exports.PlayerState = exports.EntityState = exports.BotcraftPhysics = exports.EntityPhysics = exports.BaseSimulator = exports.PhysicsWorldSettings = exports.EPhysicsCtx = exports.PhysicsUtilWrapper = void 0;
4
4
  exports.default = loader;
5
5
  exports.initSetup = initSetup;
6
6
  const settings_1 = require("./physics/settings");
@@ -14,6 +14,8 @@ function loader(bot) {
14
14
  function initSetup(data) {
15
15
  settings_1.EPhysicsCtx.loadData(data);
16
16
  }
17
+ var wrapper_2 = require("./wrapper");
18
+ Object.defineProperty(exports, "PhysicsUtilWrapper", { enumerable: true, get: function () { return wrapper_2.PhysicsUtilWrapper; } });
17
19
  var settings_2 = require("./physics/settings");
18
20
  Object.defineProperty(exports, "EPhysicsCtx", { enumerable: true, get: function () { return settings_2.EPhysicsCtx; } });
19
21
  Object.defineProperty(exports, "PhysicsWorldSettings", { enumerable: true, get: function () { return settings_2.PhysicsWorldSettings; } });
@@ -14,10 +14,11 @@ const entity_physics_json_1 = __importDefault(require("../info/entity_physics.js
14
14
  const physicsSettings_1 = require("./physicsSettings");
15
15
  const states_2 = require("../states");
16
16
  function load(data) {
17
+ const dataStr = data.version.type === "pc" ? data.version.minecraftVersion : `bedrock_${data.version.minecraftVersion}`;
17
18
  EPhysicsCtx.mcData = data;
18
19
  EPhysicsCtx.entityData = data["entitiesByName"];
19
20
  EPhysicsCtx.mobData = data["mobs"];
20
- EPhysicsCtx.entityConstructor = prismarine_entity_1.default(data.version.minecraftVersion);
21
+ EPhysicsCtx.entityConstructor = prismarine_entity_1.default(dataStr);
21
22
  }
22
23
  exports.emptyVec = new vec3_1.Vec3(0, 0, 0);
23
24
  class EPhysicsCtx {
@@ -172,6 +172,8 @@ class EntityState {
172
172
  bot.entity.onClimbable = this.onClimbable;
173
173
  bot.entity.yaw = this.yaw;
174
174
  bot.entity.pitch = this.pitch;
175
+ bot.entity.height = this.height;
176
+ bot.entity.width = this.halfWidth * 2;
175
177
  bot.controlState = this.control;
176
178
  bot.jumpTicks = this.jumpTicks;
177
179
  bot.jumpQueued = this.jumpQueued;
@@ -332,6 +332,9 @@ class PlayerState {
332
332
  bot.sprintTriggerTime = this.sprintTriggerTime;
333
333
  bot.entity.yaw = this.yaw;
334
334
  bot.entity.pitch = this.pitch;
335
+ bot.entity.height = this.height;
336
+ bot.entity.width = this.halfWidth * 2;
337
+ bot.entity.eyeHeight = this.eyeHeight;
335
338
  Object.assign(bot.entity, this.pose);
336
339
  bot.game.gameMode = this.gameMode; // this should never actually be in charge.
337
340
  bot.food = this.food; // this should also never actually be in charge.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxg-org/mineflayer-physics-util",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "Provides functionality for more accurate entity and projectile tracking.",
5
5
  "keywords": [
6
6
  "mineflayer",