Skip to content

1.19.30 Example Server Not Sending Chunks Properly #302

Answered by Bluebotlabz
Bluebotlabz asked this question in Q&A
Discussion options

You must be logged in to vote

UPDATE: It turns out, you can just spam (certain) packets to the client, my new code does this and it works:

// Send all the chunks
for (const file of fs.readdirSync(`./chunks`)) {
  const chunkData = JSON.parse(fs.readFileSync(`./chunks/` + file))

  client.queue("level_chunk", chunkData)
}

and

client.on("subchunk_request", (data) => {
  console.log("subchunk request:", data.origin)
  
  for (const file of fs.readdirSync(`./subchunks`)) {
    const chunkData = JSON.parse(fs.readFileSync(`./subchunks/` + file))
    
    // send all potentially matching subchunks
    if (chunkData.origin.x === data.origin.x && chunkData.origin.y === data.origin.y && chunkData.origin.z === data.origin.z) {

Replies: 11 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Bluebotlabz
Comment options

@Bluebotlabz
Comment options

@extremeheat
Comment options

@Bluebotlabz
Comment options

@extremeheat
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hvlxh
Comment options

Answer selected by Bluebotlabz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #301 on October 16, 2022 07:47.