diff options
Diffstat (limited to 'util.lua')
-rw-r--r-- | util.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,8 +1,12 @@ +function mesecons_debug.check_pos(pos) + return type(pos) == "table" and type(pos.x) == "number" and type(pos.y) == "number" and type(pos.z) == "number" +end + function mesecons_debug.get_blockpos(pos) return { x = math.floor(pos.x / 16), y = math.floor(pos.y / 16), - z = math.floor(pos.z / 16) + z = math.floor(pos.z / 16), } end @@ -10,12 +14,12 @@ function mesecons_debug.hashpos(pos) return minetest.hash_node_position({ x = math.floor(pos.x / 16), y = math.floor(pos.y / 16), - z = math.floor(pos.z / 16) + z = math.floor(pos.z / 16), }) end - function mesecons_debug.wait(n) local wait_until = minetest.get_us_time() + n - while minetest.get_us_time() < wait_until do end + while minetest.get_us_time() < wait_until do + end end |