prismarine-physics 1.5.2 → 1.6.0

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/HISTORY.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## History
2
2
 
3
+ ### 1.6.0
4
+
5
+ * Fix left and right (@Kashalls)
6
+ * Fix 1.19 Water Physics (@ATXLtheAxolotl)
7
+
3
8
  ### 1.5.2
4
9
 
5
10
  * Fix publish.yml
package/examples/basic.js CHANGED
@@ -13,7 +13,7 @@ const fakeWorld = {
13
13
  }
14
14
  }
15
15
 
16
- function fakePlayer (pos) {
16
+ function fakePlayer (pos, baseVersion) {
17
17
  return {
18
18
  entity: {
19
19
  position: pos,
@@ -24,10 +24,15 @@ function fakePlayer (pos) {
24
24
  isInWeb: false,
25
25
  isCollidedHorizontally: false,
26
26
  isCollidedVertically: false,
27
- yaw: 0
27
+ yaw: 0,
28
+ effects: []
29
+ },
30
+ inventory: {
31
+ slots: []
28
32
  },
29
33
  jumpTicks: 0,
30
- jumpQueued: false
34
+ jumpQueued: false,
35
+ version: baseVersion
31
36
  }
32
37
  }
33
38
 
@@ -41,7 +46,7 @@ const controls = {
41
46
  sprint: false,
42
47
  sneak: false
43
48
  }
44
- const player = fakePlayer(new Vec3(0, 80, 0))
49
+ const player = fakePlayer(new Vec3(0, 80, 0), mcData.version.version)
45
50
  const playerState = new PlayerState(player, controls)
46
51
 
47
52
  while (!player.entity.onGround) {
package/index.js CHANGED
@@ -89,6 +89,8 @@ function Physics (mcData, world) {
89
89
  } else if (supportFeature('proportionalLiquidGravity')) {
90
90
  physics.waterGravity = physics.gravity / 16
91
91
  physics.lavaGravity = physics.gravity / 4
92
+ } else {
93
+ throw new Error('No liquid gravity settings, have you made sure the liquid gravity features are up to date?')
92
94
  }
93
95
 
94
96
  function getPlayerBB (pos) {
@@ -354,8 +356,8 @@ function Physics (mcData, world) {
354
356
  const cos = Math.cos(yaw)
355
357
 
356
358
  const vel = entity.vel
357
- vel.x += strafe * cos - forward * sin
358
- vel.z += forward * cos + strafe * sin
359
+ vel.x -= strafe * cos + forward * sin
360
+ vel.z += forward * cos - strafe * sin
359
361
  }
360
362
 
361
363
  function isOnLadder (world, pos) {
package/lib/features.json CHANGED
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "name": "proportionalLiquidGravity",
9
9
  "description": "Liquid gravity is a proportion of normal gravity",
10
- "versions": ["1.13", "1.14", "1.15", "1.16", "1.17", "1.18"]
10
+ "versions": ["1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "1.19"]
11
11
  },
12
12
  {
13
13
  "name": "velocityBlocksOnCollision",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismarine-physics",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "Provide the physics engine for minecraft entities",
5
5
  "main": "index.js",
6
6
  "directories": {