Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min. Y -64: Sections starting at 0 and not -64! #144

Open
SinanAkkoyun opened this issue Sep 5, 2024 · 0 comments
Open

Min. Y -64: Sections starting at 0 and not -64! #144

SinanAkkoyun opened this issue Sep 5, 2024 · 0 comments

Comments

@SinanAkkoyun
Copy link

I am debugging the issue that mineflayer flatworlds for 1.20.1 do not render at all (but are able to have the click raycast)

I noticed that for all sections of a chunk, the y value starts at 0, not at -64.

(to reproduce, console.log in mineflayer-viewers worker.js:)

function setSectionDirty (pos, value = true) {
  const x = Math.floor(pos.x / 16) * 16
  const y = Math.floor(pos.y / 16) * 16
  const z = Math.floor(pos.z / 16) * 16
  const chunk = world.getColumn(x, z)
  const key = sectionKey(x, y, z)
  // console.log('Chunk:', chunk)
  if(y < 0) {
    console.log(key)
    console.log('Sections:', chunk ? JSON.stringify(chunk.sections) : 'No chunk')
  }

  if (!value) {
    delete dirtySections[key]
    postMessage({ type: 'sectionFinished', key })
  } else if (chunk && chunk.sections[Math.floor(y / 16)]) {
    dirtySections[key] = value
  } else {
    postMessage({ type: 'sectionFinished', key })
  }
}

Now, I already removed every < 0 instance with < -64, loops starting at y 0 -> y -64 and stuff like that, in both prismarine-world (world.js: initialize: if (y >= height || y < -64) { return false }) and mineflayer-viewer (too many to list).

But I don't understand why it simply won't load, but all bot functionalities work!!!

I'd be super grateful for any advice, thanks a lot!

@SinanAkkoyun SinanAkkoyun changed the title y < 0 -> No chunk data for section! Min. Y -64: Sections starting at 0 and not -64! Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant