-
Notifications
You must be signed in to change notification settings - Fork 114
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
Clean way to set block state on local chunk coordinates? #169
Labels
Comments
For now I came with following procedure: func SetChunkBlock(c *level.Chunk, lx, ly, lz, bs int) {
sid := (ly+64)/16 + 4
if len(c.Sections) <= sid {
log.Printf("Failed to set block %d at %d %d %d because there is no section %d (%d allocated)", bs, lx, ly, lz, sid, len(c.Sections))
return
}
c.Sections[sid].SetBlock((ly%16)*16*16+lz*16+lx, bs)
} However client ignores chunk or block is not actually placed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to make procedural generation for chunks, is there a better way of setting block state than calculating section and local section coordinates? Maybe a helper function of some sort would be nice.
The text was updated successfully, but these errors were encountered: