cartographer/chunk_api.lua

18 lines
487 B
Lua
Raw Normal View History

local CHUNK_SIZE = 16;
-- Contains functions for converting coordinates between world units and the
-- unit used by cartographer's maps
return {
-- Convert world coordinates to map coordinates
-- coord: The coordinate value
to = function(coord)
return math.floor(coord / CHUNK_SIZE);
end,
-- Convert map coordinates to world coordinates
-- coord: The coordinate value
from = function(coord)
return math.floor(coord * CHUNK_SIZE);
end
};