Lymkwi / python-minetest

A python library to manipulate minetest's files
6 stars 3 forks source link

understanding mapblocks #6

Closed ghost closed 8 years ago

ghost commented 8 years ago

i'm trying to understand how mapblocks are named and am looking at this code: https://github.com/LeMagnesium/python-minetest/blob/master/libminetest/utils.py#L36

so a mapblock is 16x16x16 but along each of the x,y,z axis doesn't this mean that from -15 to 15 is block 0? but that's 31 nodes?

what I really need to know is what the mapblock boundaries are. is x=0 in block 0,,

in a lua mod we just get emin, emax from the vm object... and I think the convention for naming mapchunks you do something like math.floor((pos.x+32)/80) but I don't know if that is just a convention. shouldn't the mapblock be something like math.floor((pos.x+8)/16)?

ghost commented 8 years ago

duh nevermind i forgot how floor works with negatives hahaha