throw an unsupported protocol version in createServer when asking for an unsupported version

This commit is contained in:
Romain Beaumont 2019-07-07 23:26:28 +02:00
parent c59d9e2687
commit d3a9f7dcea
No known key found for this signature in database
GPG Key ID: DB60E388B3BCF286

View File

@ -26,6 +26,7 @@ function createServer (options = {}) {
const optVersion = version === undefined || version === false ? require('./version').defaultVersion : version
const mcData = require('minecraft-data')(optVersion)
if (!mcData) throw new Error(`unsupported protocol version: ${optVersion}`)
const mcversion = mcData.version
const hideErrors = options.hideErrors || false