Skip to content

Initial 1.20.2 support#3243

Closed
crux153 wants to merge 4 commits into
PrismarineJS:masterfrom
crux153:mc-1.20.2
Closed

Initial 1.20.2 support#3243
crux153 wants to merge 4 commits into
PrismarineJS:masterfrom
crux153:mc-1.20.2

Conversation

@crux153
Copy link
Copy Markdown
Contributor

@crux153 crux153 commented Dec 12, 2023

This PR adds preliminary support for version 1.20.2.

Before merging this PR, we need PrismarineJS/prismarine-nbt#78 and PrismarineJS/node-minecraft-protocol#1264 to be merged and released.

I have tested that a bot can successfully log in to an offline server and interact with chunks using this patch. But I believe additional testing is necessary.

@crux153 crux153 mentioned this pull request Dec 12, 2023
@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Dec 17, 2023

can you

  • add the new version in the tested versions to trigger tests
  • update the version towards the open PRs for the changed deps

@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Dec 27, 2023

added the version in tested version

some things needed here:

@rom1504 rom1504 mentioned this pull request Dec 30, 2023
@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Dec 30, 2023

https://minecraft.fandom.com/wiki/Java_Edition_1.20 references of new things

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.20.2/protocol.json to diff against https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.20/protocol.json

tasks here

  • list things that need update here
  • do it here and potentially in sub packages (pchunk ?)
  • make tests work
  • test a few examples manually

@Newtbot
Copy link
Copy Markdown

Newtbot commented Dec 30, 2023

https://minecraft.fandom.com/wiki/Java_Edition_1.20 references of new things

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.20.2/protocol.json to diff against https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.20.1/protocol.json

tasks here

  • list things that need update here
  • do it here and potentially in sub packages (pchunk ?)
  • make tests work
  • test a few examples manually

the protocol.json link redirect to 404

@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Dec 30, 2023

Fixed

@wgaylord
Copy link
Copy Markdown
Contributor

Adding this into the block.js in mineflayer adds support for the chunk batch system. Normally MC clients average the last 15 chunk batches but I think we can get away with not doing that.

var chunkBatchStartTime = 0
  bot._client.on('chunk_batch_start', (packet) => {
    chunkBatchStartTime = Date.now()
  })
  
  bot._client.on('chunk_batch_finished', (packet) => {
    var chunkPerMili = packet.batchSize / (Date.now() - chunkBatchStartTime)
    bot._client.write('chunk_batch_received', {
      chunksPerTick: 25 / chunkPerMili
    })
  })

@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Dec 30, 2023

moving to #3262 to make things easier to contribute to

@rom1504 rom1504 closed this Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

4 participants