Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b4c9136
Update CI to Node 24
rom1504 Mar 29, 2026
b5cc771
Fix spawn and velocity packets to use vec3i16 velocity field
rom1504 Mar 30, 2026
0c29527
Retrigger CI after node-minecraft-protocol release
rom1504 Mar 30, 2026
0a88b75
fix: disconnect bots before server quit to avoid Node 24 zlib error
rom1504 Mar 30, 2026
9535571
Fix afterEach: use timeout instead of waiting for end event
rom1504 Mar 31, 2026
3272e31
Suppress zlib uncaught errors from Node 24 stricter decompression
rom1504 Mar 31, 2026
b170964
Use minecraft-protocol zlib fix branch, remove workaround
rom1504 Mar 31, 2026
ff0710b
Re-add uncaughtException handler for streaming zlib errors
rom1504 Mar 31, 2026
0ab4954
Remove uncaughtException workaround
rom1504 Mar 31, 2026
6474b19
Retrigger CI with sync zlib fix in NMP
rom1504 Mar 31, 2026
80ec836
Retrigger CI with sync zlib in NMP (cache bust)
rom1504 Mar 31, 2026
189e2b1
Re-add uncaughtException handler for deep zlib errors
rom1504 Mar 31, 2026
91a34ad
Use prismarine-nbt zlib fix, remove uncaughtException handler
rom1504 Mar 31, 2026
368c794
Retrigger CI with prismarine-nbt fix in dep chain
rom1504 Mar 31, 2026
a401764
Retrigger with fixed prismarine-nbt
rom1504 Mar 31, 2026
658be62
Use prismarine-provider-anvil zlib fix, replace node-gzip with native…
rom1504 Mar 31, 2026
8201fac
Add --retries 3 to CI for transient zlib errors on Node 24
rom1504 Mar 31, 2026
c72ea65
Retry mocha at process level for uncaught zlib errors
rom1504 Mar 31, 2026
304613e
Use sync gzip, remove bash retry workaround
rom1504 Mar 31, 2026
8a29a41
Revert to normal deps, keep node-gzip removal + async gzip
rom1504 Apr 1, 2026
f958641
Depend on NMP fix branch for destroyed-state zlib checks
rom1504 Apr 1, 2026
1ac2df1
Use sync gzip in playerDat + NMP sync zlib fix
rom1504 Apr 1, 2026
ccc7cc0
Retrigger CI
rom1504 Apr 1, 2026
8de2a08
Depend on all 3 sync zlib fix branches
rom1504 Apr 1, 2026
719e4c6
Use released versions of sync zlib dependencies
rom1504 Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Use Node.js 22.x
uses: actions/setup-node@v1.4.4
with:
node-version: 22.x
node-version: 24
- run: npm i && npm run lint

PrepareTestedVersions:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Use Node.js 22.x
uses: actions/setup-node@v1.4.4
with:
node-version: 22.x
node-version: 24
- id: set-matrix
run: |
node -e "
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Use Node.js 22.x
uses: actions/setup-node@v1.4.4
with:
node-version: 22.x
node-version: 24
- name: Install Dependencies
run: npm install
- name: Start Tests
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@
"exit-hook": "^2.2.1",
"flatmap": "^0.0.3",
"long": "^5.1.0",
"minecraft-protocol": "^1.53.0",
"minecraft-protocol": "^1.66.0",
"moment": "^2.10.6",
"needle": "^2.5.0",
"node-gzip": "^1.1.2",
"prismarine-chunk": "^1.34.0",
"prismarine-entity": "^2.2.0",
"prismarine-item": "^1.14.0",
"prismarine-nbt": "^2.2.1",
"prismarine-provider-anvil": "^2.7.0",
"prismarine-nbt": "^2.8.0",
"prismarine-provider-anvil": "^2.13.0",
"prismarine-registry": "^1.7.0",
"prismarine-windows": "^2.8.0",
"prismarine-world": "^3.6.2",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/playerDat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ const fs = require('fs')
const Vec3 = require('vec3').Vec3
const nbt = require('prismarine-nbt')
const long = require('long')
const { gzip } = require('node-gzip')
const zlib = require('zlib')
const { promisify } = require('util')
const convertInventorySlotId = require('./convertInventorySlotId')

// Use sync gzip to avoid uncaught async zlib errors during teardown.
// See nodejs/node#62325, nodejs/node#61202
const gzip = (data) => Promise.resolve(zlib.gzipSync(data))

const nbtParse = promisify(nbt.parse)

const playerDefaults = {
Expand Down
1 change: 1 addition & 0 deletions src/lib/plugins/physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports.entity = function (entity, serv, { version }) {
scaledVelocity = scaledVelocity.floored()
entity._writeNearby('entity_velocity', {
entityId: entity.id,
velocity: scaledVelocity,
velocityX: scaledVelocity.x,
velocityY: scaledVelocity.y,
velocityZ: scaledVelocity.z
Expand Down
1 change: 1 addition & 0 deletions src/lib/plugins/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ module.exports.entity = function (entity, serv) {
headPitch: entity.headPitch,
currentItem: 0,
objectData: entity.data,
velocity: scaledVelocity,
velocityX: scaledVelocity.x,
velocityY: scaledVelocity.y,
velocityZ: scaledVelocity.z,
Expand Down
8 changes: 8 additions & 0 deletions test/mineflayer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ squid.testedVersions.forEach((testedVersion, i) => {

afterEach(async () => {
console.log('Quitting server...')
// Disconnect bots before stopping the server so the compressed
// stream is drained cleanly. Without this, Node 24's stricter
// zlib can throw an uncaught "unexpected end of file" error when
// the server force-kicks clients and truncates the compressed data.
try { bot?.quit() } catch (e) { /* ignore */ }
try { bot2?.quit() } catch (e) { /* ignore */ }
// Give bots time to disconnect cleanly
await new Promise(resolve => setTimeout(resolve, 500))
await serv.quit()
console.log('Quit server!')
})
Expand Down
Loading