Closed ghost closed 8 years ago
getAsInt
's default value for max_val
(the maximum, unreachable coordinate in the container) is 16. When you use a Pos
object to refer to a mapblock, the container is the map, and the map can contain up to 4096*2 mapblocks (negative and positive) in all directions, so you should use mapblockpos.getAsInt(max_val=4096)
for the calculation to work.
EDIT: Also, I realized that the modulo I applied on the coordinates in the Pos' getAsInt function annihilated negative values; oops. It's fixed now (and your script seems to be working fine).
init_mapblock and map:save debug statements are showing the integer position as the x part of the position for blocks:
and