Skip to content

Commit

Permalink
Lint, begone!
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin John committed Jan 4, 2024
1 parent 20a620a commit 16c9497
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ class MCServer extends EventEmitter {
connect (options) {
const mcData = require('minecraft-data')(options.version)
const version = mcData.version
let { 0: maxMajor, 1: maxMinor, 2: maxPatch = 0 } = latestSupportedVersion.split('.')
let { 0: minMajor, 1: minMinor, 2: minPatch = 0 } = oldestSupportedVersion.split('.')
let { 0: major, 1: minor, 2: patch = 0 } = version.minecraftVersion.split('.')
const { 0: maxMajor, 1: maxMinor, 2: maxPatch = 0 } = latestSupportedVersion.split('.')
const { 0: minMajor, 1: minMinor, 2: minPatch = 0 } = oldestSupportedVersion.split('.')
const { 0: major, 1: minor, 2: patch = 0 } = version.minecraftVersion.split('.')
if (major > maxMajor || (major === maxMajor && minor > maxMinor) || (major === maxMajor && minor === maxMinor && patch > maxPatch)) {
console.warn(`[WARNING] Version ${version.minecraftVersion} is newer than the latest supported version, ${latestSupportedVersion}`)
console.warn(`[WARNING] The latest supported version is ${latestSupportedVersion}`)
console.warn(`[WARNING] It is unlikely that flying-squid will work correctly with this version`)
console.warn('[WARNING] It is unlikely that flying-squid will work correctly with this version')
} else if (major < minMajor || (major === minMajor && minor < minMinor) || (major === minMajor && minor === minMinor && patch < minPatch)) {
console.warn(`[WARNING] Version ${version.minecraftVersion} is older than the oldest supported version, ${oldestSupportedVersion}`)
console.warn(`[WARNING] The oldest supported version is ${oldestSupportedVersion}`)
console.warn(`[WARNING] It is unlikely that flying-squid will work correctly with this version`)
console.warn('[WARNING] It is unlikely that flying-squid will work correctly with this version')
}

this.supportFeature = feature => mcData.supportFeature(feature)
Expand Down

0 comments on commit 16c9497

Please sign in to comment.