Skip to content

Commit

Permalink
fix bot version select
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Sep 16, 2023
1 parent 53794a2 commit 4f1f947
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ async function connect(connectOptions: {
await loadScript(`./mc-data/${toMajorVersion(version)}.js`)
}

const version = connectOptions.botVersion ?? serverOptions.version
if (version) {
await downloadMcData(version)
const downloadVersion = connectOptions.botVersion || singeplayer ? serverOptions.version : undefined
if (downloadVersion) {
await downloadMcData(downloadVersion)
}

if (singeplayer) {
Expand Down Expand Up @@ -443,13 +443,13 @@ async function connect(connectOptions: {
bot = mineflayer.createBot({
host,
port,
version: connectOptions.botVersion === '' ? false : connectOptions.botVersion,
version: !connectOptions.botVersion ? false : connectOptions.botVersion,
...singeplayer || p2pMultiplayer ? {
version: serverOptions.version,
keepAlive: false,
stream: botDuplex,
} : {},
...singeplayer ? {
version: serverOptions.version,
connect() { },
customCommunication: usingCustomCommunication ? customCommunication : undefined,
} : {},
Expand Down

0 comments on commit 4f1f947

Please sign in to comment.