diff --git a/HISTORY.md b/HISTORY.md index dab88a0..ca92394 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +## 3.21.0 +* 1.19.40 support (#314) +* types: Fix missing field in ServerAdvertisement (#313) (@minerj101) + ## 3.20.1 * Fix buffer length calculation in ServerAdvertisement (#292) (thanks @KurtThiemann) * Handle Relay serialization errors by kicking (#290) diff --git a/package.json b/package.json index 3223743..58b2fb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bedrock-protocol", - "version": "3.20.1", + "version": "3.21.0", "description": "Minecraft Bedrock Edition protocol library", "main": "index.js", "scripts": { diff --git a/tools/startVanillaServer.js b/tools/startVanillaServer.js index 9c6e924..0df2e1b 100644 --- a/tools/startVanillaServer.js +++ b/tools/startVanillaServer.js @@ -5,7 +5,14 @@ const debug = process.env.CI ? console.debug : require('debug')('minecraft-proto const https = require('https') const { getFiles, waitFor } = require('../src/datatypes/util') -const head = (url) => new Promise((resolve, reject) => http.request(url, { method: 'HEAD', timeout: 500 }, resolve).on('error', reject).end()) +function head (url) { + return new Promise((resolve, reject) => { + const req = http.request(url, { method: 'HEAD', timeout: 500 }, resolve) + req.on('error', reject) + req.on('timeout', () => { req.destroy(); debug('HEAD request timeout'); reject(new Error('timeout')) }) + req.end() + }) +} function get (url, outPath) { const file = fs.createWriteStream(outPath) return new Promise((resolve, reject) => {